stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
#endif
- if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
+#ifdef SVQC
+ entity tg = find(world, targetname, self.target);
+ if(tg.spawnflags & 4)
+ {
+ self.use = train_use;
+ self.SUB_THINK = func_null;
+ self.SUB_NEXTTHINK = 0;
+ }
+ else
+#endif
+ if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
{
self.train_wait_turning = false;
train_next();
_sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
}
+REGISTER_NET_LINKED(ENT_CLIENT_TRAIN)
+
#ifdef SVQC
float train_send(entity to, float sf)
{SELFPARAM();
- WriteByte(MSG_ENTITY, ENT_CLIENT_TRAIN);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_TRAIN);
WriteByte(MSG_ENTITY, sf);
if(sf & SF_TRIGGER_INIT)
WriteString(MSG_ENTITY, self.model);
- trigger_common_write(true);
+ trigger_common_write(self, true);
WriteString(MSG_ENTITY, self.curvetarget);
void train_draw(entity this)
{
//Movetype_Physics_NoMatchServer();
- Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
+ Movetype_Physics_MatchServer(this, autocvar_cl_projectiles_sloppy);
}
-void ent_train()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew)
+{
float sf = ReadByte();
if(sf & SF_TRIGGER_INIT)
{
// TODO: make a reset function for trains
}
+
+ return true;
}
#endif