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);
WriteShort(MSG_ENTITY, this.wait);
WriteShort(MSG_ENTITY, this.speed);
if(sf & SF_TRIGGER_UPDATE)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
-
- 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.origin);
+
+ WriteVector(MSG_ENTITY, this.pos1);
+ WriteVector(MSG_ENTITY, this.pos2);
}
return true;
trigger_common_read(this, true);
- vector v;
-
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.pos1 = v;
-
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.pos2 = v;
+ this.pos1 = ReadVector();
+ this.pos2 = ReadVector();
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
- this.size = v;
+ this.size = ReadVector();
this.wait = ReadShort();
this.speed = ReadShort();
if(sf & SF_TRIGGER_UPDATE)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
- 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();
}
return true;
}