self.velocity_x = ReadCoord();
self.velocity_y = ReadCoord();
self.velocity_z = ReadCoord();
- self.gravity = ReadCoord();
+ if(f & 0x10)
+ self.gravity = ReadCoord();
+ else
+ self.gravity = 0; // default
self.move_origin = self.origin;
self.move_velocity = self.velocity;
}
- if(time == self.spawntime || (self.count & 0x80) || (f & 0x10))
+ if(time == self.spawntime || (self.count & 0x80) || (f & 0x08))
{
self.trail_oldorigin = self.origin;
if(!(self.count & 0x80))
{
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
sf |= 0x20;
}
+ if(self.gravity != 0 && self.gravity != 1)
+ sf |= 0x10;
+
WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
WriteByte(MSG_ENTITY, 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)
if(e.SendEntity == CSQCProjectile_SendEntity)
{
// send new origin data
- e.SendFlags |= 1;
+ e.SendFlags |= 0x01;
}
}
{
if(e.SendEntity == CSQCProjectile_SendEntity)
{
- // send new origin data and mark as teleported
- e.SendFlags |= 0x11;
+ // send new origin data
+ e.SendFlags |= 0x01;
+ // mark as teleported
+ e.SendFlags |= 0x08;
}
}