X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fcsqcprojectile.qc;h=07f6f5c6651bd1615b35761921119294ee0d8bcd;hb=4e21f418ad9e6287efb942c1fa2861a51981110a;hp=0edf22664ae8eba7e89fff4851c5c98001019b17;hpb=c0da80fe6125a43ee99a90808ac6f9d0ddcf88c8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 0edf22664..07f6f5c66 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -1,11 +1,12 @@ #include "csqcprojectile.qh" -#include - -#include "../command/common.qh" - #include -#include +#include +#include +#include +#include +#include +#include .float csqcprojectile_type; @@ -39,15 +40,11 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf) if(sf & 1) { - WriteCoord(MSG_ENTITY, this.origin.x); - WriteCoord(MSG_ENTITY, this.origin.y); - WriteCoord(MSG_ENTITY, this.origin.z); + WriteVector(MSG_ENTITY, this.origin); if(sf & 0x80) { - WriteCoord(MSG_ENTITY, this.velocity.x); - WriteCoord(MSG_ENTITY, this.velocity.y); - WriteCoord(MSG_ENTITY, this.velocity.z); + WriteVector(MSG_ENTITY, this.velocity); if(sf & 0x10) WriteCoord(MSG_ENTITY, this.gravity); } @@ -58,7 +55,10 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf) WriteByte(MSG_ENTITY, fr); } - WriteByte(MSG_ENTITY, this.realowner.team); + if(teamplay) + WriteByte(MSG_ENTITY, this.realowner.team); + else + WriteByte(MSG_ENTITY, this.realowner.clientcolors); // NOTE: doesn't work on non-clients } if(sf & 2) @@ -83,7 +83,7 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull) e.csqcprojectile_clientanimate = clientanimate; - if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE) + if(e.move_movetype == MOVETYPE_TOSS || e.move_movetype == MOVETYPE_BOUNCE) { if(e.gravity == 0) e.gravity = 1; @@ -98,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull) void UpdateCSQCProjectile(entity e) { - if(e.SendEntity3 == CSQCProjectile_SendEntity) + if(getSendEntity(e) == CSQCProjectile_SendEntity) { // send new origin data e.SendFlags |= 0x01; } // FIXME HACK - else if(e.SendEntity3 == ItemSend) + else if(getSendEntity(e) == ItemSend) { ItemUpdate(e); } @@ -113,10 +113,14 @@ void UpdateCSQCProjectile(entity e) void UpdateCSQCProjectileAfterTeleport(entity e) { - if(e.SendEntity3 == CSQCProjectile_SendEntity) + if(getSendEntity(e) == CSQCProjectile_SendEntity) { // send new origin data e.SendFlags |= 0x01; + // send full data as the projectile may need resetting + // this is a workaround for client-side projectiles erroneously calling their SUB_Stop touch function occasionally + // when passing through a warpzone + e.SendFlags |= 2; // mark as teleported e.SendFlags |= 0x08; }