+#include "plat.qh"
REGISTER_NET_LINKED(ENT_CLIENT_PLAT)
#ifdef SVQC
trigger_common_write(this, true);
- WriteCoord(MSG_ENTITY, this.pos1_x);
- WriteCoord(MSG_ENTITY, this.pos1_y);
- WriteCoord(MSG_ENTITY, this.pos1_z);
- WriteCoord(MSG_ENTITY, this.pos2_x);
- WriteCoord(MSG_ENTITY, this.pos2_y);
- WriteCoord(MSG_ENTITY, this.pos2_z);
+ WriteVector(MSG_ENTITY, this.pos1);
+ WriteVector(MSG_ENTITY, this.pos2);
- WriteCoord(MSG_ENTITY, this.size_x);
- WriteCoord(MSG_ENTITY, this.size_y);
- WriteCoord(MSG_ENTITY, this.size_z);
+ WriteVector(MSG_ENTITY, this.size);
WriteAngle(MSG_ENTITY, this.mangle_x);
WriteAngle(MSG_ENTITY, this.mangle_y);
spawnfunc(func_plat)
{
- if (this.sounds == 0) this.sounds = 2;
-
- if (this.spawnflags & 4) this.dmg = 10000;
+ if (this.spawnflags & CRUSH)
+ {
+ this.dmg = 10000;
+ }
- if (this.dmg && (this.message == "")) this.message = "was squished";
- if (this.dmg && (this.message2 == "")) this.message2 = "was squished by";
+ if (this.dmg && (this.message == ""))
+ {
+ this.message = "was squished";
+ }
+ if (this.dmg && (this.message2 == ""))
+ {
+ this.message2 = "was squished by";
+ }
if (this.sounds == 1)
{
- precache_sound ("plats/plat1.wav");
- precache_sound ("plats/plat2.wav");
this.noise = "plats/plat1.wav";
this.noise1 = "plats/plat2.wav";
}
if (this.sounds == 2)
{
- precache_sound ("plats/medplat1.wav");
- precache_sound ("plats/medplat2.wav");
this.noise = "plats/medplat1.wav";
this.noise1 = "plats/medplat2.wav";
}
+ // WARNING: backwards compatibility because people don't use already existing fields :(
if (this.sound1)
- {
- precache_sound (this.sound1);
this.noise = this.sound1;
- }
if (this.sound2)
- {
- precache_sound (this.sound2);
this.noise1 = this.sound2;
+
+ if(this.noise && this.noise != "")
+ {
+ precache_sound(this.noise);
+ }
+ if(this.noise1 && this.noise1 != "")
+ {
+ precache_sound(this.noise1);
}
this.mangle = this.angles;
trigger_common_read(this, true);
- this.pos1_x = ReadCoord();
- this.pos1_y = ReadCoord();
- this.pos1_z = ReadCoord();
- this.pos2_x = ReadCoord();
- this.pos2_y = ReadCoord();
- this.pos2_z = ReadCoord();
+ this.pos1 = ReadVector();
+ this.pos2 = ReadVector();
- this.size_x = ReadCoord();
- this.size_y = ReadCoord();
- this.size_z = ReadCoord();
+ this.size = ReadVector();
this.mangle_x = ReadAngle();
this.mangle_y = ReadAngle();
this.classname = "plat";
this.solid = SOLID_BSP;
- this.movetype = MOVETYPE_PUSH;
+ set_movetype(this, MOVETYPE_PUSH);
this.drawmask = MASK_NORMAL;
this.draw = plat_draw;
+ if (isnew) IL_PUSH(g_drawables, this);
this.use = plat_use;
this.entremove = trigger_remove_generic;
plat_reset(this); // also called here
- this.move_movetype = MOVETYPE_PUSH;
- this.move_origin = this.origin;
- this.move_angles = this.angles;
+ set_movetype(this, MOVETYPE_PUSH);
this.move_time = time;
plat_spawn_inside_trigger(this);
{
plat_reset(this);
- this.move_origin = this.origin;
- this.move_angles = this.angles;
this.move_time = time;
}
return true;