1 .float csqcprojectile_type;
3 float CSQCProjectile_SendEntity(entity to, float sf)
7 // note: flag 0x08 = no trail please (teleport bit)
10 if(self.csqcprojectile_clientanimate)
11 sf |= 0x80; // client animated, not interpolated
13 if(self.flags & FL_ONGROUND)
17 if(self.fade_time != 0 || self.fade_rate != 0)
19 ft = (self.fade_time - time) / sys_frametime;
20 fr = (1 / self.fade_rate) / sys_frametime;
21 if(ft <= 255 && fr <= 255 && fr >= 1)
28 WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
29 WriteByte(MSG_ENTITY, sf);
33 WriteCoord(MSG_ENTITY, self.origin_x);
34 WriteCoord(MSG_ENTITY, self.origin_y);
35 WriteCoord(MSG_ENTITY, self.origin_z);
39 WriteCoord(MSG_ENTITY, self.velocity_x);
40 WriteCoord(MSG_ENTITY, self.velocity_y);
41 WriteCoord(MSG_ENTITY, self.velocity_z);
43 WriteCoord(MSG_ENTITY, self.gravity);
48 WriteByte(MSG_ENTITY, ft);
49 WriteByte(MSG_ENTITY, fr);
54 WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
59 .vector csqcprojectile_oldorigin;
60 void CSQCProjectile_Check(entity e)
62 if(e.csqcprojectile_clientanimate)
63 if(e.flags & FL_ONGROUND)
64 if(e.origin != e.csqcprojectile_oldorigin)
65 UpdateCSQCProjectile(e);
66 e.csqcprojectile_oldorigin = e.origin;
69 void CSQCProjectile(entity e, float clientanimate, float type, float docull)
71 Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
73 e.csqcprojectile_clientanimate = clientanimate;
75 if(e.movetype == MOVETYPE_TOSS || e.movetype == MOVETYPE_BOUNCE)
83 if(!sound_allowed(MSG_BROADCAST, e))
85 e.csqcprojectile_type = type;
89 float ItemSend(entity to, float sf);
90 void ItemUpdate(entity item);
92 void UpdateCSQCProjectile(entity e)
94 if(e.SendEntity == CSQCProjectile_SendEntity)
96 // send new origin data
100 else if(e.SendEntity == ItemSend)
107 void UpdateCSQCProjectileAfterTeleport(entity e)
109 if(e.SendEntity == CSQCProjectile_SendEntity)
111 // send new origin data
113 // mark as teleported