X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fcsqcprojectile.qc;h=f3e9f22ef6859a2b8e538a39e6b14be0b602c92f;hb=724a41faf2cbfd86d41f3ab59ff8326a831a8326;hp=3dd93c0581a3433a4a16a37bfb75f5438f7a253b;hpb=d2cd0d526937f5c2f892ca588690f76eb64f870f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 3dd93c058..f3e9f22ef 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -1,6 +1,15 @@ +#include "csqcprojectile.qh" + +#include + +#include "../command/common.qh" + +#include +#include + .float csqcprojectile_type; -float CSQCProjectile_SendEntity(entity to, float sf) +bool CSQCProjectile_SendEntity(entity this, entity to, int sf) { float ft, fr; @@ -10,7 +19,7 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(self.csqcprojectile_clientanimate) sf |= 0x80; // client animated, not interpolated - if(self.flags & FL_ONGROUND) + if(IS_ONGROUND(self)) sf |= 0x40; ft = fr = 0; @@ -25,20 +34,20 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(self.gravity != 0) sf |= 0x10; - WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE); + WriteHeader(MSG_ENTITY, ENT_CLIENT_PROJECTILE); WriteByte(MSG_ENTITY, sf); if(sf & 1) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); if(sf & 0x80) { - WriteCoord(MSG_ENTITY, self.velocity_x); - WriteCoord(MSG_ENTITY, self.velocity_y); - WriteCoord(MSG_ENTITY, self.velocity_z); + WriteCoord(MSG_ENTITY, self.velocity.x); + WriteCoord(MSG_ENTITY, self.velocity.y); + WriteCoord(MSG_ENTITY, self.velocity.z); if(sf & 0x10) WriteCoord(MSG_ENTITY, self.gravity); } @@ -55,20 +64,20 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(sf & 2) WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf? - return 1; + return true; } .vector csqcprojectile_oldorigin; void CSQCProjectile_Check(entity e) { if(e.csqcprojectile_clientanimate) - if(e.flags & FL_ONGROUND) + if(IS_ONGROUND(e)) if(e.origin != e.csqcprojectile_oldorigin) UpdateCSQCProjectile(e); e.csqcprojectile_oldorigin = e.origin; } -void CSQCProjectile(entity e, float clientanimate, float type, float docull) +void CSQCProjectile(entity e, float clientanimate, int type, float docull) { Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity); @@ -89,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, float type, float docull) void UpdateCSQCProjectile(entity e) { - if(e.SendEntity == CSQCProjectile_SendEntity) + if(e.SendEntity3 == CSQCProjectile_SendEntity) { // send new origin data e.SendFlags |= 0x01; } // FIXME HACK - else if(e.SendEntity == ItemSend) + else if(e.SendEntity3 == ItemSend) { ItemUpdate(e); } @@ -104,7 +113,7 @@ void UpdateCSQCProjectile(entity e) void UpdateCSQCProjectileAfterTeleport(entity e) { - if(e.SendEntity == CSQCProjectile_SendEntity) + if(e.SendEntity3 == CSQCProjectile_SendEntity) { // send new origin data e.SendFlags |= 0x01;