#include "csqcprojectile.qh"
-#include "../t_items.qh"
+#include <common/t_items.qh>
#include "../command/common.qh"
-#include "../../common/constants.qh"
-#include "../../common/weapons/all.qh"
+#include <common/constants.qh>
+#include <common/weapons/all.qh>
.float csqcprojectile_type;
// note: flag 0x08 = no trail please (teleport bit)
sf = sf & 0x0F;
- if(self.csqcprojectile_clientanimate)
+ if(this.csqcprojectile_clientanimate)
sf |= 0x80; // client animated, not interpolated
- if(self.flags & FL_ONGROUND)
+ if(IS_ONGROUND(this))
sf |= 0x40;
ft = fr = 0;
- if(self.fade_time != 0 || self.fade_rate != 0)
+ if(this.fade_time != 0 || this.fade_rate != 0)
{
- ft = (self.fade_time - time) / sys_frametime;
- fr = (1 / self.fade_rate) / sys_frametime;
+ ft = (this.fade_time - time) / sys_frametime;
+ fr = (1 / this.fade_rate) / sys_frametime;
if(ft <= 255 && fr <= 255 && fr >= 1)
sf |= 0x20;
}
- if(self.gravity != 0)
+ if(this.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, this.origin.x);
+ WriteCoord(MSG_ENTITY, this.origin.y);
+ WriteCoord(MSG_ENTITY, this.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, this.velocity.x);
+ WriteCoord(MSG_ENTITY, this.velocity.y);
+ WriteCoord(MSG_ENTITY, this.velocity.z);
if(sf & 0x10)
- WriteCoord(MSG_ENTITY, self.gravity);
+ WriteCoord(MSG_ENTITY, this.gravity);
}
if(sf & 0x20)
WriteByte(MSG_ENTITY, fr);
}
- WriteByte(MSG_ENTITY, self.realowner.team);
+ WriteByte(MSG_ENTITY, this.realowner.team);
}
if(sf & 2)
- WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
+ WriteByte(MSG_ENTITY, this.csqcprojectile_type); // TODO maybe put this into sf?
return true;
}
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;