X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcsqcprojectile.qc;h=3554f1ff67235142f837507183b772c41c841c09;hb=026dde2924af9bca060bc1bea3e194c47e98b4be;hp=e585b1e37900497737a4800e9f5e5192588a7b50;hpb=0e7ed909bffb4ff21f0c68d163edfc17487e380a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/csqcprojectile.qc b/qcsrc/server/csqcprojectile.qc index e585b1e37..3554f1ff6 100644 --- a/qcsrc/server/csqcprojectile.qc +++ b/qcsrc/server/csqcprojectile.qc @@ -4,8 +4,8 @@ float CSQCProjectile_SendEntity(entity to, float sf) { float ft, fr; - // note: flag 0x10 = no trail please - sf = sf & 0x1F; + // note: flag 0x08 = no trail please (teleport bit) + sf = sf & 0x0F; if(self.csqcprojectile_clientanimate) sf |= 0x80; // client animated, not interpolated @@ -13,7 +13,8 @@ float CSQCProjectile_SendEntity(entity to, float sf) if(self.flags & FL_ONGROUND) sf |= 0x40; - if(self.fade_time != 0 && self.fade_rate != 0) + ft = fr = 0; + if(self.fade_time != 0 || self.fade_rate != 0) { ft = (self.fade_time - time) / sys_frametime; fr = (1 / self.fade_rate) / sys_frametime; @@ -21,6 +22,9 @@ float CSQCProjectile_SendEntity(entity to, float sf) sf |= 0x20; } + if(self.gravity != 0) + sf |= 0x10; + WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE); WriteByte(MSG_ENTITY, sf); @@ -35,7 +39,8 @@ float CSQCProjectile_SendEntity(entity to, float sf) WriteCoord(MSG_ENTITY, self.velocity_x); WriteCoord(MSG_ENTITY, self.velocity_y); WriteCoord(MSG_ENTITY, self.velocity_z); - WriteCoord(MSG_ENTITY, self.gravity); + if(sf & 0x10) + WriteCoord(MSG_ENTITY, self.gravity); } if(sf & 0x20) @@ -75,9 +80,9 @@ void CSQCProjectile(entity e, float clientanimate, float type, float docull) else e.gravity = 0; - e.csqcprojectile_type = type; if(!sound_allowed(MSG_BROADCAST, e)) type |= 0x80; + e.csqcprojectile_type = type; } void UpdateCSQCProjectile(entity e) @@ -85,7 +90,7 @@ void UpdateCSQCProjectile(entity e) if(e.SendEntity == CSQCProjectile_SendEntity) { // send new origin data - e.SendFlags |= 1; + e.SendFlags |= 0x01; } } @@ -93,29 +98,9 @@ void UpdateCSQCProjectileAfterTeleport(entity e) { if(e.SendEntity == CSQCProjectile_SendEntity) { - // send new origin data and mark as teleported - e.SendFlags |= 0x11; - } -} - -.void(void) csqcprojectile_oldthink; -.float csqcprojectile_oldnextthink; - -void CSQCProjectile_Update_Think() -{ - UpdateCSQCProjectile(self); - self.think = self.csqcprojectile_oldthink; - self.nextthink = max(time, self.csqcprojectile_oldnextthink); -} - -void UpdateCSQCProjectileNextFrame(entity e) -{ - if(e.SendEntity == CSQCProjectile_SendEntity) - if(e.think != CSQCProjectile_Update_Think) - { - e.csqcprojectile_oldthink = e.think; - e.csqcprojectile_oldnextthink = e.nextthink; - e.think = CSQCProjectile_Update_Think; - e.nextthink = time; + // send new origin data + e.SendFlags |= 0x01; + // mark as teleported + e.SendFlags |= 0x08; } }