X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fcsqcprojectile.qc;h=f3e9f22ef6859a2b8e538a39e6b14be0b602c92f;hb=0ce2bdf81013a9a30117a5e3083d536ced038bb3;hp=773b7f085bea4e9c275501429895d251d176fca6;hpb=bb80a6aba067167c6ef8d5f3465f03bd34142fa2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 773b7f085..f3e9f22ef 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -1,19 +1,15 @@ -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../common/constants.qh" - #include "../../common/weapons/weapons.qh" - #include "csqcprojectile.qh" - #include "../t_items.qh" - #include "../constants.qh" - #include "../defs.qh" - #include "../command/common.qh" -#endif +#include "csqcprojectile.qh" + +#include + +#include "../command/common.qh" + +#include +#include .float csqcprojectile_type; -float CSQCProjectile_SendEntity(entity to, int sf) +bool CSQCProjectile_SendEntity(entity this, entity to, int sf) { float ft, fr; @@ -23,7 +19,7 @@ float CSQCProjectile_SendEntity(entity to, int 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; @@ -38,7 +34,7 @@ float CSQCProjectile_SendEntity(entity to, int 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) @@ -68,14 +64,14 @@ float CSQCProjectile_SendEntity(entity to, int 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; @@ -102,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, int 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); } @@ -117,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;