Server Help

ASSS Questions - Detecting fired weapons

Initrd.gz - Tue Dec 16, 2008 9:08 pm
Post subject: Detecting fired weapons
Hi. I am looking at hscore's hscore_wepevents.c file on how the module detects weapons for the ammo system. It uses a function called net->AddPacket, which links a function to monitor when a packet is sent (right? biggrin.gif). I was wondering how it got the weapons part out. I understand the case switch but not how it gets the value. The line is (line 20):
Code: Show/Hide
struct C2SPosition *pos = (struct C2SPosition *)p2;


Ps writing this in python

Thanks

offtopic: asss.yi.org down? icon_confused.gif
Dr Brain - Tue Dec 16, 2008 10:00 pm
Post subject:
If the function gets called, then p2 must be a weapons packet (the length check is just to make extra sure). The line you quoted simply casts the pointer into a weapons packet pointer.
Initrd.gz - Fri Dec 19, 2008 10:56 am
Post subject:
K. Anyway to do it with python? Ty for the help
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group