#ifdef SVQC
+void plat_link();
+
void plat_delayedinit()
{
- plat_spawn_inside_trigger (); // the "start moving" trigger
+ plat_link();
+ plat_spawn_inside_trigger(); // the "start moving" trigger
}
float plat_send(entity to, float sf)
if(sf & SF_TRIGGER_INIT)
{
- WriteShort(MSG_ENTITY, num_for_edict(self));
- WriteString(MSG_ENTITY, self.target);
- WriteString(MSG_ENTITY, self.target2);
- WriteString(MSG_ENTITY, self.target3);
- WriteString(MSG_ENTITY, self.target4);
- WriteString(MSG_ENTITY, self.targetname);
-
WriteByte(MSG_ENTITY, self.platmovetype_start);
WriteByte(MSG_ENTITY, self.platmovetype_turn);
WriteByte(MSG_ENTITY, self.platmovetype_end);
-
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
+ WriteByte(MSG_ENTITY, self.spawnflags);
WriteString(MSG_ENTITY, self.model);
- WriteCoord(MSG_ENTITY, self.mins_x);
- WriteCoord(MSG_ENTITY, self.mins_y);
- WriteCoord(MSG_ENTITY, self.mins_z);
- WriteCoord(MSG_ENTITY, self.maxs_x);
- WriteCoord(MSG_ENTITY, self.maxs_y);
- WriteCoord(MSG_ENTITY, self.maxs_z);
+ trigger_common_write(true);
WriteCoord(MSG_ENTITY, self.pos1_x);
WriteCoord(MSG_ENTITY, self.pos1_y);
WriteCoord(MSG_ENTITY, self.size_y);
WriteCoord(MSG_ENTITY, self.size_z);
- WriteAngle(MSG_ENTITY, self.angles_x);
- WriteAngle(MSG_ENTITY, self.angles_y);
- WriteAngle(MSG_ENTITY, self.angles_z);
-
WriteAngle(MSG_ENTITY, self.mangle_x);
WriteAngle(MSG_ENTITY, self.mangle_y);
WriteAngle(MSG_ENTITY, self.mangle_z);
void plat_link()
{
- Net_LinkEntity(self, 0, false, plat_send);
+ //Net_LinkEntity(self, 0, false, plat_send);
}
void spawnfunc_func_plat()
self.reset = plat_reset;
plat_reset();
- plat_link();
-
InitializeEntity(self, plat_delayedinit, INITPRIO_FINDTARGET);
}
#elif defined(CSQC)
void plat_draw()
{
- float dt = time - self.move_time;
- self.move_time = time;
- if(dt <= 0) { return; }
-
- setorigin(self, self.origin + self.velocity * dt);
+ Movetype_Physics_NoMatchServer();
+ //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
}
void ent_plat()
if(sf & SF_TRIGGER_INIT)
{
- self.sv_entnum = ReadShort();
- self.target = strzone(ReadString());
- self.target2 = strzone(ReadString());
- self.target3 = strzone(ReadString());
- self.target4 = strzone(ReadString());
- self.targetname = strzone(ReadString());
-
self.platmovetype_start = ReadByte();
self.platmovetype_turn = ReadByte();
self.platmovetype_end = ReadByte();
-
- self.origin_x = ReadCoord();
- self.origin_y = ReadCoord();
- self.origin_z = ReadCoord();
- setorigin(self, self.origin);
+ self.spawnflags = ReadByte();
self.model = strzone(ReadString());
setmodel(self, self.model);
- self.mins_x = ReadCoord();
- self.mins_y = ReadCoord();
- self.mins_z = ReadCoord();
- self.maxs_x = ReadCoord();
- self.maxs_y = ReadCoord();
- self.maxs_z = ReadCoord();
- setsize(self, self.mins, self.maxs);
+ trigger_common_read(true);
self.pos1_x = ReadCoord();
self.pos1_y = ReadCoord();
self.size_y = ReadCoord();
self.size_z = ReadCoord();
- self.angles_x = ReadAngle();
- self.angles_y = ReadAngle();
- self.angles_z = ReadAngle();
-
self.mangle_x = ReadAngle();
self.mangle_y = ReadAngle();
self.mangle_z = ReadAngle();
self.dmg = ReadShort();
+ self.classname = "plat";
self.solid = SOLID_BSP;
self.movetype = MOVETYPE_PUSH;
self.drawmask = MASK_NORMAL;
self.draw = plat_draw;
self.use = plat_use;
+ self.entremove = trigger_remove_generic;
plat_reset(); // also called here
+
+ self.move_movetype = MOVETYPE_PUSH;
+ self.move_origin = self.origin;
+ self.move_angles = self.angles;
+ self.move_time = time;
+
+ plat_spawn_inside_trigger();
}
if(sf & SF_TRIGGER_RESET)
{
plat_reset();
+
+ self.move_origin = self.origin;
+ self.move_angles = self.angles;
+ self.move_time = time;
}
}
#endif