#include "csqcprojectile.qh"
-#include "../_all.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;
-bool CSQCProjectile_SendEntity(entity to, int sf)
-{SELFPARAM();
+bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
+{
float ft, fr;
// note: flag 0x08 = no trail please (teleport bit)
if(self.csqcprojectile_clientanimate)
sf |= 0x80; // client animated, not interpolated
- if(self.flags & FL_ONGROUND)
+ if(IS_ONGROUND(self))
sf |= 0x40;
ft = fr = 0;
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)
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;
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);
}
void UpdateCSQCProjectileAfterTeleport(entity e)
{
- if(e.SendEntity == CSQCProjectile_SendEntity)
+ if(e.SendEntity3 == CSQCProjectile_SendEntity)
{
// send new origin data
e.SendFlags |= 0x01;