#include "../../../server/defs.qh"
#endif
+REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC)
+REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC_TRIGGER)
+
#ifdef SVQC
void viewloc_think()
bool trigger_viewloc_send(entity this, entity to, int sf)
{
// CSQC doesn't need to know our origin (yet), as we're only available for referencing
- WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER);
WriteEntity(MSG_ENTITY, self.enemy);
WriteEntity(MSG_ENTITY, self.goalentity);
bool viewloc_send(entity this, entity to, int sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_VIEWLOC);
WriteByte(MSG_ENTITY, self.cnt);
self.goalentity = findfloat(world, entnum, self.count);
}
-void ent_viewloc_trigger()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
+{
float point1 = ReadShort();
float point2 = ReadShort();
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+
+ return = true;
+
setorigin(self, self.origin);
self.cnt = point1;
self.drawmask = MASK_NORMAL; // not so concerned, but better keep it alive
}
-void ent_viewloc()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_VIEWLOC, bool isnew)
+{
self.cnt = ReadByte();
self.origin_x = ReadCoord();
self.movedir_y = ReadCoord();
self.movedir_z = ReadCoord();
+ return = true;
+
self.classname = ((self.cnt == 2) ? "target_viewlocation_end" : "target_viewlocation_start");
self.drawmask = MASK_NORMAL; // don't cull it
}