NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new)
{
float teamnum = (ReadByte() - 1);
- vector spn_origin;
- spn_origin.x = ReadCoord();
- spn_origin.y = ReadCoord();
- spn_origin.z = ReadCoord();
+ vector spn_origin = ReadVector();
this.team = (teamnum + 1);
if(entnum)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
if(is_new)
{
if(sendflags & 1)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
if(sendflags & 2)
{
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
}
if(sendflags & 4)
if(f & 2)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
this.scale = ReadShort() / 256.0;
if(f & 0x20)
{
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
}
else
this.mins = this.maxs = '0 0 0';
this.bgmscriptdecay = ReadByte() / 64.0;
this.bgmscriptsustain = ReadByte() / 255.0;
this.bgmscriptrelease = ReadByte() / 64.0;
- this.movedir_x = ReadCoord();
- this.movedir_y = ReadCoord();
- this.movedir_z = ReadCoord();
+ this.movedir = ReadVector();
this.lip = ReadByte() / 255.0;
}
this.fade_start = ReadByte();
if (f & 1)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
if (this.count & 0x80)
{
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
if (f & 0x10)
this.gravity = ReadCoord();
else
Net_Accept(net_debug);
this.sv_entnum = ReadShort();
if (ReadByte()) make_pure(this);
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.debug = true; // identify server entities by this
this.classname = strzone(ReadString());
o = (this.absmin + this.absmax) / 2;
if (this.tag_entity)
o += this.tag_entity.origin;
- WriteCoord(channel, o.x); WriteCoord(channel, o.y); WriteCoord(channel, o.z);
+ WriteVector(channel, o);
WriteString(channel, this.classname);
WriteString(channel, this.sourceLoc);
return true;
vector vel = '0 0 0';
int eff_cnt = 1;
bool eff_trail = eff.eent_eff_trail;
- vector v;
- v_x = ReadCoord();
- v_y = ReadCoord();
- v_z = ReadCoord();
+ vector v = ReadVector();
bool use_vel = ReadByte();
if(use_vel)
- {
- vel_x = ReadCoord();
- vel_y = ReadCoord();
- vel_z = ReadCoord();
- }
+ vel = ReadVector();
if(!eff_trail)
eff_cnt = ReadByte();
(Effects_COUNT >= 255)
? WriteShort(channel, this.m_id)
: WriteByte(channel, this.m_id);
- WriteCoord(channel, this.eent_net_location_x);
- WriteCoord(channel, this.eent_net_location_y);
- WriteCoord(channel, this.eent_net_location_z);
+ WriteVector(channel, this.eent_net_location);
// attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set
if(this.eent_net_velocity)
{
WriteByte(channel, true);
- WriteCoord(channel, this.eent_net_velocity_x);
- WriteCoord(channel, this.eent_net_velocity_y);
- WriteCoord(channel, this.eent_net_velocity_z);
+ WriteVector(channel, this.eent_net_velocity);
}
else { WriteByte(channel, false); }
WriteHeader(MSG_ALL, casings);
WriteByte(MSG_ALL, casingtype);
- WriteCoord(MSG_ALL, org.x);
- WriteCoord(MSG_ALL, org.y);
- WriteCoord(MSG_ALL, org.z);
+ WriteVector(MSG_ALL, org);
WriteShort(MSG_ALL, compressShortVector(vel)); // actually compressed velocity
WriteByte(MSG_ALL, ang.x * 256 / 360);
WriteByte(MSG_ALL, ang.y * 256 / 360);
NET_HANDLE(casings, bool isNew)
{
int _state = ReadByte();
- vector org;
- org_x = ReadCoord();
- org_y = ReadCoord();
- org_z = ReadCoord();
+ vector org = ReadVector();
vector vel = decompressShortVector(ReadShort());
vector ang;
ang_x = ReadByte() * 360 / 256;
bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
{
+ vector org = vec3(floor(this.origin.x), floor(this.origin.y), floor(this.origin.z));
WriteHeader(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
WriteShort(MSG_ENTITY, this.projectiledeathtype);
- WriteCoord(MSG_ENTITY, floor(this.origin.x));
- WriteCoord(MSG_ENTITY, floor(this.origin.y));
- WriteCoord(MSG_ENTITY, floor(this.origin.z));
+ WriteVector(MSG_ENTITY, org);
WriteByte(MSG_ENTITY, bound(1, this.dmg, 255));
WriteByte(MSG_ENTITY, bound(0, this.dmg_radius, 255));
WriteByte(MSG_ENTITY, bound(1, this.dmg_edge, 255));
w_issilent = (w_deathtype & 0x8000);
w_deathtype = (w_deathtype & 0x7FFF);
- w_org.x = ReadCoord();
- w_org.y = ReadCoord();
- w_org.z = ReadCoord();
+ w_org = ReadVector();
thedamage = ReadByte();
rad = ReadByte();
WriteByte(channel, floor(_atten * 64));
entcs_force_origin(from);
vector o = from.origin + 0.5 * (from.mins + from.maxs);
- WriteCoord(channel, o.x);
- WriteCoord(channel, o.y);
- WriteCoord(channel, o.z);
+ WriteVector(channel, o);
}
/**
WriteByte(channel, floor(_atten * 64));
entcs_force_origin(from);
vector o = from.origin + 0.5 * (from.mins + from.maxs);
- WriteCoord(channel, o.x);
- WriteCoord(channel, o.y);
- WriteCoord(channel, o.z);
+ WriteVector(channel, o);
}
#endif
int chan = ReadSByte();
float vol = ReadByte() / 255;
float atten = ReadByte() / 64;
- vector o;
- o.x = ReadCoord();
- o.y = ReadCoord();
- o.z = ReadCoord();
+ vector o = ReadVector();
// TODO: is this really what we want to be doing? Footsteps that follow the player at head height?
if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume
else if (e) e.origin = o;
int chan = ReadSByte();
float vol = ReadByte() / 255;
float atten = ReadByte() / 64;
- vector o;
- o.x = ReadCoord();
- o.y = ReadCoord();
- o.z = ReadCoord();
+ vector o = ReadVector();
if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume
else if (e) e.origin = o;
if (e)
{
WriteHeader(MSG_BROADCAST, TE_CSQC_ARC);
- WriteCoord(MSG_BROADCAST, from.x);
- WriteCoord(MSG_BROADCAST, from.y);
- WriteCoord(MSG_BROADCAST, from.z);
- WriteCoord(MSG_BROADCAST, to.x);
- WriteCoord(MSG_BROADCAST, to.y);
- WriteCoord(MSG_BROADCAST, to.z);
+ WriteVector(MSG_BROADCAST, from);
+ WriteVector(MSG_BROADCAST, to);
}
#elif defined(CSQC)
NET_HANDLE(TE_CSQC_ARC, bool isNew)
{
- vector from;
- from.x = ReadCoord();
- from.y = ReadCoord();
- from.z = ReadCoord();
- vector to;
- to.x = ReadCoord();
- to.y = ReadCoord();
- to.z = ReadCoord();
+ vector from = ReadVector();
+ vector to = ReadVector();
return = true;
if (autocvar_cl_effects_lightningarc_simple)
WriteShort(MSG_ENTITY, this.modelindex);
WriteByte(MSG_ENTITY, this.skin);
WriteByte(MSG_ENTITY, this.frame);
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
if(f & 1)
{
- WriteCoord(MSG_ENTITY, this.velocity.x);
- WriteCoord(MSG_ENTITY, this.velocity.y);
- WriteCoord(MSG_ENTITY, this.velocity.z);
+ WriteVector(MSG_ENTITY, this.velocity);
}
if(f & 2)
{
e.skin = ReadByte();
e.frame = ReadByte();
e.frame1time = time;
- e.origin_x = ReadCoord();
- e.origin_y = ReadCoord();
- e.origin_z = ReadCoord();
+ e.origin = ReadVector();
setorigin(e, e.origin);
if(f & 1)
{
- e.velocity_x = ReadCoord();
- e.velocity_y = ReadCoord();
- e.velocity_z = ReadCoord();
+ e.velocity = ReadVector();
}
if(f & 2)
{
if(sf & CPSF_SETUP)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.health = ReadByte();
if(sf & GSF_SETUP)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.health = ReadByte();
entity generator_camera;
NET_HANDLE(ENT_ONSCAMERA, bool isnew)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.angles_x = ReadAngle();
WriteByte(MSG_ENTITY, sf);
if(sf & CPSF_SETUP)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteByte(MSG_ENTITY, this.health);
WriteByte(MSG_ENTITY, this.max_health);
WriteByte(MSG_ENTITY, sf);
if(sf & GSF_SETUP)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteByte(MSG_ENTITY, this.health);
WriteByte(MSG_ENTITY, this.max_health);
{
WriteHeader(MSG_ENTITY, ENT_ONSCAMERA);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteAngle(MSG_ENTITY, this.angles_x);
WriteAngle(MSG_ENTITY, this.angles_y);
WriteByte(MSG_ENTITY, sendflags);
if(sendflags & 1)
{
- WriteCoord(MSG_ENTITY, this.goalentity.origin_x);
- WriteCoord(MSG_ENTITY, this.goalentity.origin_y);
- WriteCoord(MSG_ENTITY, this.goalentity.origin_z);
+ WriteVector(MSG_ENTITY, this.goalentity.origin);
}
if(sendflags & 2)
{
- WriteCoord(MSG_ENTITY, this.enemy.origin_x);
- WriteCoord(MSG_ENTITY, this.enemy.origin_y);
- WriteCoord(MSG_ENTITY, this.enemy.origin_z);
+ WriteVector(MSG_ENTITY, this.enemy.origin);
}
if(sendflags & 4)
{
Net_Accept(Nade_Orb);
int sf = ReadByte();
if (sf & 1) {
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
- this.colormod_x = ReadCoord();
- this.colormod_y = ReadCoord();
- this.colormod_z = ReadCoord();
+ this.colormod = ReadVector();
this.orb_lifetime = ReadByte();
this.orb_radius = ReadShort();
this.ltime = time + ReadByte()/10.0;
WriteHeader(channel, Nade_Orb);
WriteByte(channel, sf);
if (sf & 1) {
- WriteCoord(channel, this.origin.x);
- WriteCoord(channel, this.origin.y);
- WriteCoord(channel, this.origin.z);
+ WriteVector(channel, this.origin);
- WriteCoord(channel, this.colormod.x);
- WriteCoord(channel, this.colormod.y);
- WriteCoord(channel, this.colormod.z);
+ WriteVector(channel, this.colormod);
WriteByte(channel, this.orb_lifetime);
//WriteByte(MSG_ENTITY, this.ltime - time + 1);
if (sendflags & 64)
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if (sendflags & 1)
if (sendflags & 64)
{
// unfortunately, this needs to be exact (for the 3D display)
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
if(sf & ISF_LOCATION)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.oldorigin = this.origin;
}
this.pushable = true;
//this.angles = '0 0 0';
set_movetype(this, MOVETYPE_TOSS);
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
setorigin(this, this.oldorigin);
if(!this.move_time)
//WriteByte(MSG_ENTITY, this.cnt);
if(sf & ISF_LOCATION)
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(sf & ISF_ANGLES)
if(sf & ISF_DROP)
{
- WriteCoord(MSG_ENTITY, this.velocity.x);
- WriteCoord(MSG_ENTITY, this.velocity.y);
- WriteCoord(MSG_ENTITY, this.velocity.z);
+ WriteVector(MSG_ENTITY, this.velocity);
}
return true;
if(sf & 1)
{
WriteByte(MSG_ENTITY, this.warpzone_isboxy);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
- WriteCoord(MSG_ENTITY, this.mins_x);
- WriteCoord(MSG_ENTITY, this.mins_y);
- WriteCoord(MSG_ENTITY, this.mins_z);
- WriteCoord(MSG_ENTITY, this.maxs_x);
- WriteCoord(MSG_ENTITY, this.maxs_y);
- WriteCoord(MSG_ENTITY, this.maxs_z);
+ WriteVector(MSG_ENTITY, this.mins);
+ WriteVector(MSG_ENTITY, this.maxs);
- WriteCoord(MSG_ENTITY, this.movedir_x);
- WriteCoord(MSG_ENTITY, this.movedir_y);
- WriteCoord(MSG_ENTITY, this.movedir_z);
+ WriteVector(MSG_ENTITY, this.movedir);
WriteByte(MSG_ENTITY, this.speed);
WriteByte(MSG_ENTITY, this.state);
if(sf & 1)
{
this.warpzone_isboxy = ReadByte();
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
setsize(this, this.mins, this.maxs);
- this.movedir_x = ReadCoord();
- this.movedir_y = ReadCoord();
- this.movedir_z = ReadCoord();
+ this.movedir = ReadVector();
this.speed = ReadByte();
this.state = ReadByte();
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;
}
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);
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();
}
if(fl & 4)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(fl & 1)
{
WriteShort(MSG_ENTITY, this.modelindex);
if(fl & 0x80)
{
- WriteCoord(MSG_ENTITY, this.mins_x);
- WriteCoord(MSG_ENTITY, this.mins_y);
- WriteCoord(MSG_ENTITY, this.mins_z);
- WriteCoord(MSG_ENTITY, this.maxs_x);
- WriteCoord(MSG_ENTITY, this.maxs_y);
- WriteCoord(MSG_ENTITY, this.maxs_z);
+ WriteVector(MSG_ENTITY, this.mins);
+ WriteVector(MSG_ENTITY, this.maxs);
}
}
else
WriteShort(MSG_ENTITY, 0);
if(fl & 0x80)
{
- WriteCoord(MSG_ENTITY, this.maxs_x);
- WriteCoord(MSG_ENTITY, this.maxs_y);
- WriteCoord(MSG_ENTITY, this.maxs_z);
+ WriteVector(MSG_ENTITY, this.maxs);
}
}
WriteShort(MSG_ENTITY, this.cnt);
}
if(f & 4)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
}
if(f & 1)
{
{
if(this.modelindex)
{
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
}
else
{
this.mins = '0 0 0';
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.maxs = ReadVector();
}
}
else
#ifdef SVQC
bool rainsnow_SendEntity(entity this, entity to, float sf)
{
+ vector myorg = this.origin + this.mins;
+ vector mysize = this.maxs - this.mins;
WriteHeader(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
WriteByte(MSG_ENTITY, this.state);
- WriteCoord(MSG_ENTITY, this.origin_x + this.mins_x);
- WriteCoord(MSG_ENTITY, this.origin_y + this.mins_y);
- WriteCoord(MSG_ENTITY, this.origin_z + this.mins_z);
- WriteCoord(MSG_ENTITY, this.maxs_x - this.mins_x);
- WriteCoord(MSG_ENTITY, this.maxs_y - this.mins_y);
- WriteCoord(MSG_ENTITY, this.maxs_z - this.mins_z);
+ WriteVector(MSG_ENTITY, myorg);
+ WriteVector(MSG_ENTITY, mysize);
WriteShort(MSG_ENTITY, compressShortVector(this.dest));
WriteShort(MSG_ENTITY, this.count);
WriteByte(MSG_ENTITY, this.cnt);
NET_HANDLE(ENT_CLIENT_RAINSNOW, bool isnew)
{
this.impulse = ReadByte(); // Rain, Snow, or Whatever
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.origin = ReadVector();
+ this.maxs = ReadVector();
this.velocity = decompressShortVector(ReadShort());
this.count = ReadShort() * 10;
this.glow_color = ReadByte(); // color
WriteString(MSG_ENTITY, this.curvetarget);
- 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);
- WriteCoord(MSG_ENTITY, this.view_ofs_x);
- WriteCoord(MSG_ENTITY, this.view_ofs_y);
- WriteCoord(MSG_ENTITY, this.view_ofs_z);
+ WriteVector(MSG_ENTITY, this.view_ofs);
WriteAngle(MSG_ENTITY, this.mangle_x);
WriteAngle(MSG_ENTITY, this.mangle_y);
this.curvetarget = strzone(ReadString());
- 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.view_ofs_x = ReadCoord();
- this.view_ofs_y = ReadCoord();
- this.view_ofs_z = ReadCoord();
+ this.view_ofs = ReadVector();
this.mangle_x = ReadAngle();
this.mangle_y = ReadAngle();
WriteString(MSG_ENTITY, this.platmovetype);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteString(MSG_ENTITY, this.target);
WriteString(MSG_ENTITY, this.target2);
{
this.platmovetype = strzone(ReadString());
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.target = strzone(ReadString());
WriteByte(MSG_ENTITY, fl);
if(fl & 1)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(fl & 8)
{
{
if(fl & 0x80)
{
- WriteCoord(MSG_ENTITY, this.enemy.origin_x);
- WriteCoord(MSG_ENTITY, this.enemy.origin_y);
- WriteCoord(MSG_ENTITY, this.enemy.origin_z);
+ WriteVector(MSG_ENTITY, this.enemy.origin);
}
else
{
if(f & 1)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
if(f & 8)
{
if(f & 0x80)
{
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
}
else
{
WriteByte(MSG_ENTITY, this.cnt);
WriteCoord(MSG_ENTITY, this.speed);
WriteString(MSG_ENTITY, this.targetname);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteAngle(MSG_ENTITY, this.mangle_x);
WriteAngle(MSG_ENTITY, this.mangle_y);
this.cnt = ReadByte();
this.speed = ReadCoord();
this.targetname = strzone(ReadString());
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
this.mangle_x = ReadAngle();
this.mangle_y = ReadAngle();
WriteByte(MSG_ENTITY, sf);
if(sf & 4)
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(sf & 1)
{
if(this.model != "null")
{
WriteShort(MSG_ENTITY, this.modelindex);
- WriteCoord(MSG_ENTITY, this.mins.x);
- WriteCoord(MSG_ENTITY, this.mins.y);
- WriteCoord(MSG_ENTITY, this.mins.z);
- WriteCoord(MSG_ENTITY, this.maxs.x);
- WriteCoord(MSG_ENTITY, this.maxs.y);
- WriteCoord(MSG_ENTITY, this.maxs.z);
+ WriteVector(MSG_ENTITY, this.mins);
+ WriteVector(MSG_ENTITY, this.maxs);
}
else
{
WriteShort(MSG_ENTITY, 0);
- WriteCoord(MSG_ENTITY, this.maxs.x);
- WriteCoord(MSG_ENTITY, this.maxs.y);
- WriteCoord(MSG_ENTITY, this.maxs.z);
+ WriteVector(MSG_ENTITY, this.maxs);
}
WriteByte(MSG_ENTITY, this.volume * 255.0);
WriteByte(MSG_ENTITY, this.fade_time * 16.0);
int f = ReadByte();
if(f & 4)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
}
if(f & 1)
{
this.modelindex = ReadShort();
if(this.modelindex)
{
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
}
else
{
this.mins = '0 0 0';
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.maxs = ReadVector();
}
this.volume = ReadByte() / 255.0;
WriteByte(MSG_ENTITY, this.active);
WriteCoord(MSG_ENTITY, this.height);
- WriteCoord(MSG_ENTITY, this.movedir_x);
- WriteCoord(MSG_ENTITY, this.movedir_y);
- WriteCoord(MSG_ENTITY, this.movedir_z);
+ WriteVector(MSG_ENTITY, this.movedir);
trigger_common_write(this, true);
WriteByte(MSG_ENTITY, this.cnt);
WriteString(MSG_ENTITY, this.targetname);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteAngle(MSG_ENTITY, this.angles_x);
WriteAngle(MSG_ENTITY, this.angles_y);
this.active = ReadByte();
this.height = ReadCoord();
- this.movedir_x = ReadCoord();
- this.movedir_y = ReadCoord();
- this.movedir_z = ReadCoord();
+ this.movedir = ReadVector();
trigger_common_read(this, true);
this.classname = "push_target";
this.cnt = ReadByte();
this.targetname = strzone(ReadString());
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
this.angles_x = ReadAngle();
this.angles_y = ReadAngle();
WriteEntity(MSG_ENTITY, this.enemy);
WriteEntity(MSG_ENTITY, this.goalentity);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
return true;
}
WriteByte(MSG_ENTITY, this.cnt);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteAngle(MSG_ENTITY, this.angles_x);
WriteAngle(MSG_ENTITY, this.angles_y);
this.enemy = findfloat(NULL, entnum, point1);
this.goalentity = findfloat(NULL, entnum, point2);
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
return = true;
{
this.cnt = ReadByte();
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.movedir_x = ReadAngle();
WriteVector(MSG_ENTITY, this.angles);
WriteShort(MSG_ENTITY, this.modelindex);
- WriteCoord(MSG_ENTITY, this.mins.x);
- WriteCoord(MSG_ENTITY, this.mins.y);
- WriteCoord(MSG_ENTITY, this.mins.z);
- WriteCoord(MSG_ENTITY, this.maxs.x);
- WriteCoord(MSG_ENTITY, this.maxs.y);
- WriteCoord(MSG_ENTITY, this.maxs.z);
+ WriteVector(MSG_ENTITY, this.mins);
+ WriteVector(MSG_ENTITY, this.maxs);
WriteByte(MSG_ENTITY, bound(1, this.scale * 16, 255));
}
this.angles = '0 0 0';
this.modelindex = ReadShort();
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
this.scale = ReadByte() / 16;
setsize(this, this.mins, this.maxs);
}
{
this.m_id = ReadByte();
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
this.angles_x = ReadAngle();
if(sf & TNSF_MOVE)
{
- this.origin_x = ReadShort();
- this.origin_y = ReadShort();
- this.origin_z = ReadShort();
+ this.origin = ReadVector();
setorigin(this, this.origin);
- this.velocity_x = ReadShort();
- this.velocity_y = ReadShort();
- this.velocity_z = ReadShort();
+ this.velocity = ReadVector();
this.angles_y = ReadShort();
{
WriteByte(MSG_ENTITY, this.m_id);
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
WriteAngle(MSG_ENTITY, this.angles_x);
WriteAngle(MSG_ENTITY, this.angles_y);
if(sf & TNSF_MOVE)
{
- WriteShort(MSG_ENTITY, rint(this.origin_x));
- WriteShort(MSG_ENTITY, rint(this.origin_y));
- WriteShort(MSG_ENTITY, rint(this.origin_z));
+ WriteVector(MSG_ENTITY, this.origin);
- WriteShort(MSG_ENTITY, rint(this.velocity_x));
- WriteShort(MSG_ENTITY, rint(this.velocity_y));
- WriteShort(MSG_ENTITY, rint(this.velocity_z));
+ WriteVector(MSG_ENTITY, this.velocity);
WriteShort(MSG_ENTITY, rint(this.angles_y));
}
if(sf & 2)
{
- axh.origin_x = ReadCoord();
- axh.origin_y = ReadCoord();
- axh.origin_z = ReadCoord();
+ axh.origin = ReadVector();
}
if(sf & 4)
if(sf & 2)
{
- WriteCoord(MSG_ENTITY, this.origin_x);
- WriteCoord(MSG_ENTITY, this.origin_y);
- WriteCoord(MSG_ENTITY, this.origin_z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(sf & 4)
if(sf & BRG_START)
{
- WriteCoord(MSG_ENTITY, this.hook_start_x);
- WriteCoord(MSG_ENTITY, this.hook_start_y);
- WriteCoord(MSG_ENTITY, this.hook_start_z);
+ WriteVector(MSG_ENTITY, this.hook_start);
}
if(sf & BRG_END)
{
- WriteCoord(MSG_ENTITY, this.hook_end_x);
- WriteCoord(MSG_ENTITY, this.hook_end_y);
- WriteCoord(MSG_ENTITY, this.hook_end_z);
+ WriteVector(MSG_ENTITY, this.hook_end);
}
return true;
if(sf & BRG_START)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
if(sf & BRG_END)
{
- this.bumble_origin_x = ReadCoord();
- this.bumble_origin_y = ReadCoord();
- this.bumble_origin_z = ReadCoord();
+ this.bumble_origin = ReadVector();
}
return true;
}
#ifdef CSQC
NET_HANDLE(wframe, bool isNew)
{
- vector a;
- a.x = ReadCoord();
- a.y = ReadCoord();
- a.z = ReadCoord();
+ vector a = ReadVector();
int slot = ReadByte();
bool restartanim = ReadByte();
entity wepent = viewmodels[slot];
int channel = MSG_ONE;
msg_entity = actor;
WriteHeader(channel, wframe);
- WriteCoord(channel, a.x);
- WriteCoord(channel, a.y);
- WriteCoord(channel, a.z);
+ WriteVector(channel, a);
WriteByte(channel, weaponslot(weaponentity.weaponentity_fld));
WriteByte(channel, restartanim);
WriteByte(channel, weaponentity.state);
}
if(sf & ARC_SF_START) // starting location
{
- WriteCoord(MSG_ENTITY, this.beam_start.x);
- WriteCoord(MSG_ENTITY, this.beam_start.y);
- WriteCoord(MSG_ENTITY, this.beam_start.z);
+ WriteVector(MSG_ENTITY, this.beam_start);
}
if(sf & ARC_SF_WANTDIR) // want/aim direction
{
- WriteCoord(MSG_ENTITY, this.beam_wantdir.x);
- WriteCoord(MSG_ENTITY, this.beam_wantdir.y);
- WriteCoord(MSG_ENTITY, this.beam_wantdir.z);
+ WriteVector(MSG_ENTITY, this.beam_wantdir);
}
if(sf & ARC_SF_BEAMDIR) // beam direction
{
- WriteCoord(MSG_ENTITY, this.beam_dir.x);
- WriteCoord(MSG_ENTITY, this.beam_dir.y);
- WriteCoord(MSG_ENTITY, this.beam_dir.z);
+ WriteAngle(MSG_ENTITY, this.beam_dir.x);
+ WriteAngle(MSG_ENTITY, this.beam_dir.y);
+ WriteAngle(MSG_ENTITY, this.beam_dir.z);
}
if(sf & ARC_SF_BEAMTYPE) // beam type
{
if(sf & ARC_SF_START) // starting location
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
}
else if(this.beam_usevieworigin) // infer the location from player location
{
if(sf & ARC_SF_WANTDIR) // want/aim direction
{
- this.v_angle_x = ReadCoord();
- this.v_angle_y = ReadCoord();
- this.v_angle_z = ReadCoord();
+ this.v_angle = ReadVector();
}
if(sf & ARC_SF_BEAMDIR) // beam direction
{
- this.angles_x = ReadCoord();
- this.angles_y = ReadCoord();
- this.angles_z = ReadCoord();
+ this.angles_x = ReadAngle();
+ this.angles_y = ReadAngle();
+ this.angles_z = ReadAngle();
}
if(sf & ARC_SF_BEAMTYPE) // beam type
}
if(sf & 2)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
setorigin(this, this.origin);
}
if(sf & 4)
{
- this.velocity_x = ReadCoord();
- this.velocity_y = ReadCoord();
- this.velocity_z = ReadCoord();
+ this.velocity = ReadVector();
}
InterpolateOrigin_Note(this);
void W_Shockwave_Send(entity actor)
{
WriteHeader(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
- WriteCoord(MSG_BROADCAST, w_shotorg.x);
- WriteCoord(MSG_BROADCAST, w_shotorg.y);
- WriteCoord(MSG_BROADCAST, w_shotorg.z);
- WriteCoord(MSG_BROADCAST, w_shotdir.x);
- WriteCoord(MSG_BROADCAST, w_shotdir.y);
- WriteCoord(MSG_BROADCAST, w_shotdir.z);
+ WriteVector(MSG_BROADCAST, w_shotorg);
+ WriteVector(MSG_BROADCAST, w_shotdir);
WriteShort(MSG_BROADCAST, WEP_CVAR(shockwave, blast_distance));
WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_max), 255));
WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_min), 255));
shockwave.draw = Draw_Shockwave;
IL_PUSH(g_drawables, shockwave);
- shockwave.sw_shotorg_x = ReadCoord(); shockwave.sw_shotorg_y = ReadCoord(); shockwave.sw_shotorg_z = ReadCoord();
- shockwave.sw_shotdir_x = ReadCoord(); shockwave.sw_shotdir_y = ReadCoord(); shockwave.sw_shotdir_z = ReadCoord();
+ shockwave.sw_shotorg = ReadVector();
+ shockwave.sw_shotdir = ReadVector();
shockwave.sw_distance = ReadShort();
shockwave.sw_spread_max = ReadByte();
}
if (sf & 2)
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
}
return true;
}
}
if (f & 2) {
- this.enemy.origin_x = ReadCoord();
- this.enemy.origin_y = ReadCoord();
- this.enemy.origin_z = ReadCoord();
+ this.enemy.origin = ReadVector();
setorigin(this.enemy, this.enemy.origin);
if (this.enemy.enemy) {
setorigin(this.enemy.enemy, this.enemy.origin);
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WriteHeader(MSG_BROADCAST, TE_CSQC_VAPORBEAMPARTICLE);
- WriteCoord(MSG_BROADCAST, w_shotorg.x);
- WriteCoord(MSG_BROADCAST, w_shotorg.y);
- WriteCoord(MSG_BROADCAST, w_shotorg.z);
- WriteCoord(MSG_BROADCAST, v.x);
- WriteCoord(MSG_BROADCAST, v.y);
- WriteCoord(MSG_BROADCAST, v.z);
+ WriteVector(MSG_BROADCAST, w_shotorg);
+ WriteVector(MSG_BROADCAST, v);
WriteByte(MSG_BROADCAST, hit);
WriteByte(MSG_BROADCAST, etof(player));
WriteByte(MSG_BROADCAST, player.team);
if (isNew) IL_PUSH(g_drawables, this);
this.drawmask = MASK_NORMAL;
- this.vorg1_x = ReadCoord(); this.vorg1_y = ReadCoord(); this.vorg1_z = ReadCoord();
- this.vorg2_x = ReadCoord(); this.vorg2_y = ReadCoord(); this.vorg2_z = ReadCoord();
+ this.vorg1 = ReadVector();
+ this.vorg2 = ReadVector();
this.cnt = ReadByte();
int myowner = ReadByte();
this.owner = playerslots[myowner - 1];
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WriteHeader(MSG_BROADCAST, TE_CSQC_VORTEXBEAMPARTICLE);
- WriteCoord(MSG_BROADCAST, w_shotorg.x);
- WriteCoord(MSG_BROADCAST, w_shotorg.y);
- WriteCoord(MSG_BROADCAST, w_shotorg.z);
- WriteCoord(MSG_BROADCAST, v.x);
- WriteCoord(MSG_BROADCAST, v.y);
- WriteCoord(MSG_BROADCAST, v.z);
+ WriteVector(MSG_BROADCAST, w_shotorg);
+ WriteVector(MSG_BROADCAST, v);
WriteByte(MSG_BROADCAST, bound(0, 255 * charge, 255));
}
#elif defined(CSQC)
NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
{
- vector shotorg, endpos;
float charge;
- shotorg.x = ReadCoord(); shotorg.y = ReadCoord(); shotorg.z = ReadCoord();
- endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
+ vector shotorg = ReadVector();
+ vector endpos = ReadVector();
charge = ReadByte() / 255.0;
pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
#define ALLPROPERTIES_COMMON \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, int, ReadByte, WriteByte, frame) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_MODELINDEX, int, ReadShort, WriteShort, modelindex) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_x) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_y) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_z) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_x) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_y) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, mins_z) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_x) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_y) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, float, ReadShort, WriteShort, maxs_z) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, vector, ReadVector, WriteVector, origin) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, vector, ReadVector, WriteVector, mins) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, vector, ReadVector, WriteVector, maxs) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_x) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_YAW, float, ReadAngle, WriteAngle, angles_y) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_z) \
this.warpzone_isboxy = (f & 1);
if(f & 4)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
}
else
this.origin = '0 0 0';
this.modelindex = ReadShort();
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
this.scale = ReadByte() / 16;
- this.enemy.oldorigin_x = ReadCoord();
- this.enemy.oldorigin_y = ReadCoord();
- this.enemy.oldorigin_z = ReadCoord();
- this.enemy.avelocity_x = ReadCoord();
- this.enemy.avelocity_y = ReadCoord();
- this.enemy.avelocity_z = ReadCoord();
- this.oldorigin_x = ReadCoord();
- this.oldorigin_y = ReadCoord();
- this.oldorigin_z = ReadCoord();
- this.avelocity_x = ReadCoord();
- this.avelocity_y = ReadCoord();
- this.avelocity_z = ReadCoord();
+ this.enemy.oldorigin = ReadVector();
+ this.enemy.avelocity = ReadVector();
+ this.oldorigin = ReadVector();
+ this.avelocity = ReadVector();
if(f & 2)
{
int f = ReadByte();
if(f & 4)
{
- this.origin_x = ReadCoord();
- this.origin_y = ReadCoord();
- this.origin_z = ReadCoord();
+ this.origin = ReadVector();
}
else
this.origin = '0 0 0';
this.modelindex = ReadShort();
- this.mins_x = ReadCoord();
- this.mins_y = ReadCoord();
- this.mins_z = ReadCoord();
- this.maxs_x = ReadCoord();
- this.maxs_y = ReadCoord();
- this.maxs_z = ReadCoord();
+ this.mins = ReadVector();
+ this.maxs = ReadVector();
this.scale = ReadByte() / 16;
- this.oldorigin_x = ReadCoord();
- this.oldorigin_y = ReadCoord();
- this.oldorigin_z = ReadCoord();
- this.avelocity_x = ReadCoord();
- this.avelocity_y = ReadCoord();
- this.avelocity_z = ReadCoord();
+ this.oldorigin = ReadVector();
+ this.avelocity = ReadVector();
if(f & 2)
{
NET_HANDLE(ENT_CLIENT_WARPZONE_TELEPORTED, bool isnew)
{
this.classname = "warpzone_teleported";
- vector v;
- v.x = ReadCoord();
- v.y = ReadCoord();
- v.z = ReadCoord();
+ vector v = ReadVector();
return = true;
if (!isnew) return;
this.warpzone_transform = v;
bool WarpZone_Teleported_Send(entity this, entity to, int sf)
{
WriteHeader(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
- WriteCoord(MSG_ENTITY, this.angles.x);
- WriteCoord(MSG_ENTITY, this.angles.y);
- WriteCoord(MSG_ENTITY, this.angles.z);
+ WriteVector(MSG_ENTITY, this.angles);
return true;
}
#endif
}
if(sf & 2)
{
- WriteCoord(MSG_ENTITY, this.hook_start.x);
- WriteCoord(MSG_ENTITY, this.hook_start.y);
- WriteCoord(MSG_ENTITY, this.hook_start.z);
+ WriteVector(MSG_ENTITY, this.hook_start);
}
if(sf & 4)
{
- WriteCoord(MSG_ENTITY, this.hook_end.x);
- WriteCoord(MSG_ENTITY, this.hook_end.y);
- WriteCoord(MSG_ENTITY, this.hook_end.z);
+ WriteVector(MSG_ENTITY, this.hook_end);
}
return true;
}
if(sf & BIT(1))
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
}
if(sf & BIT(2))
WriteShort(MSG_ENTITY, floor(this.scale * 256));
if(sf & 0x20)
{
- WriteCoord(MSG_ENTITY, this.mins.x);
- WriteCoord(MSG_ENTITY, this.mins.y);
- WriteCoord(MSG_ENTITY, this.mins.z);
- WriteCoord(MSG_ENTITY, this.maxs.x);
- WriteCoord(MSG_ENTITY, this.maxs.y);
- WriteCoord(MSG_ENTITY, this.maxs.z);
+ WriteVector(MSG_ENTITY, this.mins);
+ WriteVector(MSG_ENTITY, this.maxs);
}
WriteString(MSG_ENTITY, this.bgmscript);
if(this.bgmscript != "")
WriteByte(MSG_ENTITY, floor(this.bgmscriptdecay * 64));
WriteByte(MSG_ENTITY, floor(this.bgmscriptsustain * 255));
WriteByte(MSG_ENTITY, floor(this.bgmscriptrelease * 64));
- WriteCoord(MSG_ENTITY, this.movedir.x);
- WriteCoord(MSG_ENTITY, this.movedir.y);
- WriteCoord(MSG_ENTITY, this.movedir.z);
+ WriteVector(MSG_ENTITY, this.movedir);
WriteByte(MSG_ENTITY, floor(this.lip * 255));
}
WriteByte(MSG_ENTITY, this.fade_start);
WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
WriteByte(MSG_ENTITY, this.team);
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
return true;
}
if(autocvar_g_spawn_alloweffects)
{
WriteByte(MSG_ENTITY, etof(this.owner));
- WriteCoord(MSG_ENTITY, this.owner.origin.x);
- WriteCoord(MSG_ENTITY, this.owner.origin.y);
- WriteCoord(MSG_ENTITY, this.owner.origin.z);
+ WriteVector(MSG_ENTITY, this.owner.origin);
send = true;
}
else if((to == this.owner) || (IS_SPEC(to) && (to.enemy == this.owner)) )
if(sf & 1)
{
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
if(sf & 0x80)
{
- WriteCoord(MSG_ENTITY, this.velocity.x);
- WriteCoord(MSG_ENTITY, this.velocity.y);
- WriteCoord(MSG_ENTITY, this.velocity.z);
+ WriteVector(MSG_ENTITY, this.velocity);
if(sf & 0x10)
WriteCoord(MSG_ENTITY, this.gravity);
}