]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make ReadVector/WriteVector more commonly used
authorMario <mario@smbclan.net>
Sat, 17 Feb 2018 13:36:12 +0000 (23:36 +1000)
committerMario <mario@smbclan.net>
Sat, 17 Feb 2018 13:36:33 +0000 (23:36 +1000)
52 files changed:
qcsrc/client/main.qc
qcsrc/client/teamradar.qc
qcsrc/client/wall.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/debug.qh
qcsrc/common/effects/all.qc
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/effects/qc/lightningarc.qc
qcsrc/common/effects/qc/modeleffects.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/mutators/mutator/nades/net.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/func/rainsnow.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/misc/corner.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/misc/teleport_dest.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/weapons/all.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/lib/csqcmodel/common.qh
qcsrc/lib/warpzone/client.qc
qcsrc/lib/warpzone/server.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_models.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/weapons/csqcprojectile.qc

index 609e03775ece1454ceaab0db07e21c7d50ad47f9..f0b8aac6c9ee3b69d1c4c51abfde9cf98f7c23ca 100644 (file)
@@ -697,10 +697,7 @@ void Spawn_PreDraw(entity this)
 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);
 
@@ -757,9 +754,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
 
        if(entnum)
        {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
+               this.origin = ReadVector();
 
                if(is_new)
                {
index 7f1654de0660b3d20890730feb19f0417c3252d6..d8264f42989f8b6810776afbdc2364a5d9b5e0c7 100644 (file)
@@ -208,17 +208,13 @@ NET_HANDLE(ENT_CLIENT_RADARLINK, bool isnew)
 
        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)
index a0d66d719e4ab04a201f990fbcb5defd7aa42822..b5728095485406213273f68f387c6096761de206 100644 (file)
@@ -143,9 +143,7 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
 
        if(f & 2)
        {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
+               this.origin = ReadVector();
                setorigin(this, this.origin);
        }
 
@@ -181,12 +179,8 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                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';
@@ -211,9 +205,7 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                        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();
index 3d2d32d9af16bff4eeb0c6ca89d1e7951c71e1c5..089c7df11fd326f0598f0243c59933a50a8a03a5 100644 (file)
@@ -236,15 +236,11 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
 
        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
index 0200883b8dbbc89867e6c888b7489889bb606f54..2d0c4e9110d7e5f22f885156721b8150febb3650 100644 (file)
@@ -16,9 +16,7 @@ REGISTER_NET_TEMP(net_debug)
                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());
@@ -40,7 +38,7 @@ REGISTER_NET_TEMP(net_debug)
                        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;
index af41054e31c1c40c462ce041a2cc540fa1c570be..252f913379a02be272548bcf60162b693e82e4be 100644 (file)
@@ -11,18 +11,11 @@ NET_HANDLE(net_effect, bool isNew)
        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();
@@ -44,17 +37,13 @@ bool Net_Write_Effect(entity this, entity client, int sf)
        (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); }
 
index 60f9633027eb2125d0278bd6abaaa2cb9ed1505a..2abf2122c26553b86634a85eb7be3bd3ef1a5a3f 100644 (file)
@@ -20,9 +20,7 @@ void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float ran
 
     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);
@@ -123,10 +121,7 @@ void Casing_Damage(entity this, float thisdmg, int hittype, vector org, vector t
 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;
index c85d66eeb6686cee70d27d77482757baf0336550..1fc64d1d259697f7fb04c691a1d83ead70ef220f 100644 (file)
@@ -6,11 +6,10 @@ REGISTER_NET_LINKED(ENT_CLIENT_DAMAGEINFO)
 
 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));
@@ -187,9 +186,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
        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();
index 874c64d5385755189e04766de0279a726cdbb70d..4875a40ee98c4682b1d7cdf4f4c8818bce87ca39 100644 (file)
@@ -42,9 +42,7 @@
                        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);
                }
 
                /**
@@ -79,9 +77,7 @@
                        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)
index 6388575b72cb09a5baa576a0e8c3882fdeff8ffb..80a1c98a83f69b6904b2bee67c4bffa818863f7e 100644 (file)
@@ -8,12 +8,8 @@ REGISTER_NET_TEMP(TE_CSQC_ARC)
        {
                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)
@@ -89,14 +85,8 @@ void b_make(vector s,vector e, string t,float l,float z)
 
        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)
index 1b70daee2fbbd5621e8e33198ffcec7c7380b2fd..26b3ec9f5285744b9f21d72abd82cab86669c5c0 100644 (file)
@@ -23,14 +23,10 @@ bool modeleffect_SendEntity(entity this, entity to, int sf)
        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)
        {
@@ -124,15 +120,11 @@ NET_HANDLE(ENT_CLIENT_MODELEFFECT, bool isnew)
        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)
        {
index ee348fdbc6244707f53e7b6202aae30cd6392ea7..a03e5b3353f8b6156eac2d8012ff5e0af9d2c96a 100644 (file)
@@ -162,9 +162,7 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew)
 
        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();
index ac7a066ab17032c3fb0ae3733bdd8ead99c686c8..a3374bf91e804f4db0ae4993eb107349d3c72411 100644 (file)
@@ -192,9 +192,7 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
 
        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();
index ae4d7a4913b3fb8afe2857b2470f179dc9bc0891..80d6a6be29fa146940ccf242cfddb9c90413e2ea 100644 (file)
@@ -9,9 +9,7 @@ REGISTER_NET_LINKED(ENT_ONSCAMERA)
 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();
index 0941833de8acd7430cc7fb35cef56c104bf405bf..d3b6d5c7f4c09f62d510db50b61c79685f1847b0 100644 (file)
@@ -10,9 +10,7 @@ bool cpicon_send(entity this, entity to, int sf)
        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);
index 1b1619bc44f621458c912c56c8f80573ab1f49c6..ac0596f2e2a5abfb3c9c21603b2a29652a31994d 100644 (file)
@@ -6,9 +6,7 @@ bool generator_send(entity this, entity to, int sf)
        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);
index 0a2aeb11c7145cc274833ba548d55b5ede68511f..2637aeef212b5415a589b42848b99f1b1290fef6 100644 (file)
@@ -38,9 +38,7 @@ bool clientcamera_send(entity this, entity to, int sf)
 {
        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);
@@ -272,15 +270,11 @@ bool ons_Link_Send(entity this, entity to, int sendflags)
        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)
        {
index 498d878d2d272341bd2ba9b04fd8908393a5e713..a691b866f789b448c8cfdf0d699cb2de892e9f85 100644 (file)
@@ -50,13 +50,9 @@ NET_HANDLE(Nade_Orb, bool isNew)
        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;
@@ -74,13 +70,9 @@ bool orb_send(entity this, entity to, int sf)
        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);
index 7b3d2abb61287228e15156b129df5cb8f9521153..be5b40c14c40c99301f8e91a7d54e08a017f9f65 100644 (file)
@@ -47,9 +47,7 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
 
     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)
@@ -159,9 +157,7 @@ void Ent_WaypointSprite(entity this, bool isnew)
     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);
     }
 
index b5a939e502125735801ef2f007abc53207bbc3ef..86da4a95bceb35fa2d633e65025b2152108aadd8 100644 (file)
@@ -158,9 +158,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
 
     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;
     }
@@ -267,9 +265,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
         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)
@@ -311,9 +307,7 @@ bool ItemSend(entity this, entity to, int sf)
        //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)
@@ -356,9 +350,7 @@ bool ItemSend(entity this, entity to, int sf)
 
        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;
index 6adbcc65f4fa4d7dc2564b466f473008f8d90042..1802a75db4a96a74ab2b56eb9531a748923bfa91 100644 (file)
@@ -85,20 +85,12 @@ bool conveyor_send(entity this, entity to, int sf)
        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);
@@ -174,22 +166,14 @@ NET_HANDLE(ENT_CLIENT_CONVEYOR, bool isnew)
        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();
index 48c91ec973b26a7d292444be4506e7ca561ff7c9..f768717c6bbde4c18c6ba50c6b05a7e773466b3a 100644 (file)
@@ -628,16 +628,10 @@ float door_send(entity this, entity to, float sf)
 
                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);
@@ -653,16 +647,10 @@ float door_send(entity this, entity to, float sf)
 
        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;
@@ -798,22 +786,10 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
 
                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();
@@ -841,17 +817,11 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
 
        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;
 }
index 36b4eeffffa1dd1af0d57f66b7207e2fde7c9802..9f97a1cea09b764d2021900fb011be0978254541 100644 (file)
@@ -26,16 +26,10 @@ float plat_send(entity this, entity to, float sf)
 
                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);
@@ -138,16 +132,10 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
 
                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();
index a0773f249a82ccfe6bc52f0fac17cb063381cbd6..54fe212ae23ead1b7f8fce4f2f02c3845083d4c7 100644 (file)
@@ -29,9 +29,7 @@ bool pointparticles_SendEntity(entity this, entity to, float fl)
        }
        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)
        {
@@ -40,12 +38,8 @@ bool pointparticles_SendEntity(entity this, entity to, float fl)
                        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
@@ -53,9 +47,7 @@ bool pointparticles_SendEntity(entity this, entity to, float fl)
                        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);
@@ -286,9 +278,7 @@ NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew)
        }
        if(f & 4)
        {
-               this.origin_x = ReadCoord();
-               this.origin_y = ReadCoord();
-               this.origin_z = ReadCoord();
+               this.origin = ReadVector();
        }
        if(f & 1)
        {
@@ -297,19 +287,13 @@ NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew)
                {
                        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
index c8b4e2924376fb510b27ba4ffb2c6d4dc1cba511..1817a9ce9a1e4d658b0b1f8411bc790734e62721 100644 (file)
@@ -4,14 +4,12 @@ REGISTER_NET_LINKED(ENT_CLIENT_RAINSNOW)
 #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);
@@ -116,12 +114,8 @@ void Draw_Snow(entity this)
 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
index c5a6e3d0393edebcbfd249296f6ecd8d78eb3dd4..ead086708196889075c18ae958df185dccb02606 100644 (file)
@@ -157,20 +157,12 @@ float train_send(entity this, entity to, float sf)
 
                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);
@@ -304,20 +296,12 @@ NET_HANDLE(ENT_CLIENT_TRAIN, bool isnew)
 
                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();
index dcc44710fc4e2fe6f746d3c8fd85b0d8da06f7de..6c9093318f6bf827abfe5caf01b254a2115ee50a 100644 (file)
@@ -8,9 +8,7 @@ bool corner_send(entity this, entity to, int sf)
 
        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);
@@ -64,9 +62,7 @@ NET_HANDLE(ENT_CLIENT_CORNER, bool isnew)
 {
        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());
index 45bd21fd1b15cd32eda5a9b170fa0732711b7029..3d5ef42d848bd7c745a7316690cb5271436baced 100644 (file)
@@ -137,9 +137,7 @@ bool laser_SendEntity(entity this, entity to, float fl)
        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)
        {
@@ -160,9 +158,7 @@ bool laser_SendEntity(entity this, entity to, float fl)
        {
                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
                {
@@ -331,9 +327,7 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
 
        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)
@@ -361,9 +355,7 @@ NET_HANDLE(ENT_CLIENT_LASER, bool isnew)
        {
                if(f & 0x80)
                {
-                       this.velocity_x = ReadCoord();
-                       this.velocity_y = ReadCoord();
-                       this.velocity_z = ReadCoord();
+                       this.velocity = ReadVector();
                }
                else
                {
index 3f5203806964b64988426406eef59eda544ec899..40c7d46c42803ce65dc2411a5da2847d190791b0 100644 (file)
@@ -13,9 +13,7 @@ bool teleport_dest_send(entity this, entity to, int sf)
                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);
@@ -78,9 +76,7 @@ NET_HANDLE(ENT_CLIENT_TELEPORT_DEST, bool isnew)
                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();
index 1f8cb00cb553a95623dec5d0eb10f3d0ca3c2e9f..7ec3351381b6265b0d24e4e16c02caa80d32fe2d 100644 (file)
@@ -103,28 +103,20 @@ bool trigger_music_SendEntity(entity this, entity to, float sf)
        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);
@@ -280,28 +272,20 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
        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;
index 9e40cfd40178224fc9c48efe76cece7de982253a..fde6e1fb9d6cf58e091ead371e1705dab06fbf49 100644 (file)
@@ -472,9 +472,7 @@ float trigger_push_send(entity this, entity to, float sf)
        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);
 
@@ -537,9 +535,7 @@ bool target_push_send(entity this, entity to, float sf)
 
        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);
@@ -595,9 +591,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
        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);
 
@@ -626,9 +620,7 @@ NET_HANDLE(ENT_CLIENT_TARGET_PUSH, bool isnew)
        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();
index 50bf3d05ee0b1e597a352f783fe0b376dd9dd2b3..8b985795da8b8701bb69239f52caa7629df156d9 100644 (file)
@@ -76,9 +76,7 @@ bool trigger_viewloc_send(entity this, entity to, int sf)
        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;
 }
@@ -125,9 +123,7 @@ bool viewloc_send(entity this, entity to, int sf)
 
        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);
@@ -178,9 +174,7 @@ NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
        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;
 
@@ -200,9 +194,7 @@ NET_HANDLE(ENT_CLIENT_VIEWLOC, bool isnew)
 {
        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();
index 6d8c5bb7efe55bafa60de6363a686e01da1aabfe..fbd20c84011596a6bd110e9f96e51f270413e4b8 100644 (file)
@@ -102,12 +102,8 @@ void trigger_common_write(entity this, bool withtarget)
                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));
 }
 
@@ -162,12 +158,8 @@ void trigger_common_read(entity this, bool withtarget)
                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);
 }
index a57719b82c070a14870f57fba365c55f7bebf6fa..ba7b5d01bb5ba25c87ce00d1ad83b55b1f81923e 100644 (file)
@@ -361,9 +361,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
        {
                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();
@@ -397,14 +395,10 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
 
        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();
 
index 21da98a48e2a5e0086368fd620d6cd4328bfd5cc..2a7c41c98c9a8a7175a5b9b5af8acc07d31f6cff 100644 (file)
@@ -313,9 +313,7 @@ bool turret_send(entity this, entity to, float sf)
        {
                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);
@@ -335,13 +333,9 @@ bool turret_send(entity this, entity to, float sf)
 
        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));
        }
index b2f87821eea414ca4b6eb764663571d4d1826c4c..51ac4bee45f3e035b19fc9895abfbce066e639e6 100644 (file)
@@ -70,9 +70,7 @@ NET_HANDLE(ENT_CLIENT_AUXILIARYXHAIR, bool isnew)
 
        if(sf & 2)
        {
-               axh.origin_x = ReadCoord();
-               axh.origin_y = ReadCoord();
-               axh.origin_z = ReadCoord();
+               axh.origin = ReadVector();
        }
 
        if(sf & 4)
index 63d662923a75d60310848c39415dab54d3a1a910..dc217bb35b646eeb3558de329004562dc2331a34 100644 (file)
@@ -9,9 +9,7 @@ bool SendAuxiliaryXhair(entity this, entity to, int sf)
 
        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)
index fa05c6a6f12dbd46343c941148c46b4c14db0366..5f4068a7d281ff3269d4cef825fbb3d333ed5765 100644 (file)
@@ -27,16 +27,12 @@ bool bumble_raygun_send(entity this, entity to, float sf)
 
     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;
@@ -75,17 +71,13 @@ NET_HANDLE(ENT_CLIENT_BUMBLE_RAYGUN, bool isnew)
 
     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;
 }
index e430ec2e78c252dea99cfc5c8fdfcc1a874bce8a..6aed090dbf793d7df997f00e320003ffd064d22a 100644 (file)
@@ -554,10 +554,7 @@ REGISTER_NET_TEMP(wframe)
 #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];
@@ -590,9 +587,7 @@ void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim)
        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);
index 7169fae4270c82a632ba48e9e312c7f4daa27ad9..6a115baf1458cbd52586d49aebe1ea6d07545bbc 100644 (file)
@@ -30,21 +30,17 @@ bool W_Arc_Beam_Send(entity this, entity to, int sf)
        }
        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
        {
@@ -1227,9 +1223,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
 
        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
        {
@@ -1249,16 +1243,14 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
 
        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
index e04376b2f4fee279a289c1bb7bb8fcb4de320e36..8d569d04e253f798debe0b17747233432166bf92 100644 (file)
@@ -466,16 +466,12 @@ NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
        }
        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);
index 7c775be2fdc39431ba18bdbb3188b4d513bc2c86..e9d55b24232353c0a5f086f5b40373f60b17f0c3 100644 (file)
@@ -257,12 +257,8 @@ float W_Shockwave_Attack_CheckHit(
 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));
@@ -766,8 +762,8 @@ void Net_ReadShockwaveParticle()
        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();
index 5d9abce339ef5b5b909831f3de44defb55c974ab..eb780808932fcd471d96d4727f6aa9cf6aae87a0 100644 (file)
@@ -223,9 +223,7 @@ bool W_Tuba_NoteSendEntity(entity this, entity to, int sf)
        }
        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;
 }
@@ -553,9 +551,7 @@ NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
        }
 
        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);
index 7dae1b3f731d2a3cf479a8a71ddd733ea1ed2afe..06562f68a8c5c5e071096d8490347449458ba47b 100644 (file)
@@ -7,12 +7,8 @@ void SendCSQCVaporizerBeamParticle(entity player, int hit) {
        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);
@@ -82,8 +78,8 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
        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];
index 7e5da5c5ac0ca1195fece8cab027fd1da2ecb202..8c590bf6e2c6841f56c2a5b978123f5fad64d3f4 100644 (file)
@@ -38,21 +38,16 @@ void SendCSQCVortexBeamParticle(float charge) {
        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);
index 37b88997ef84bf7d456e34575fc0859d79f01442..f8375d09e8202de55cdda5a61dcc6de4d85b9912 100644 (file)
@@ -66,15 +66,9 @@ const int CSQCMODEL_PROPERTY_SIZE = BIT(15);
 #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) \
index 15a3ca4c3ccc6e90870c72ab7bc74251777dd397..3a6765e9d46fbfc7ed9025238cfe8017a1fc5bde 100644 (file)
@@ -42,32 +42,18 @@ NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
        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)
        {
@@ -104,26 +90,16 @@ NET_HANDLE(ENT_CLIENT_WARPZONE_CAMERA, bool isnew)
        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)
        {
@@ -157,10 +133,7 @@ void CL_RotateMoves(vector ang) = #638;
 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;
index 936d075da8f69e2b3057d965dc35029b57b1cf23..8246e106de54165f014b548b50adb247009a7a91 100644 (file)
@@ -61,9 +61,7 @@ void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector
 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
index 7c21c45dd463aa42add4fe110329523a97c68a27..0d732e0ca4b6daba40fc5b33db54ade2db1c7501 100644 (file)
@@ -140,15 +140,11 @@ bool GrapplingHookSend(entity this, entity to, int sf)
        }
        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;
 }
index 539522f2dce7f61ca49d840f6040439450916e8c..1026e3aa7a2dfaa6b0a139c3ad75eca12e141f94 100644 (file)
@@ -106,9 +106,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
 
        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))
@@ -137,12 +135,8 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                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 != "")
@@ -151,9 +145,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                        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);
index 9f91739c19ffb2143123f28635afee326d677e49..9164b4febec31eb8c7056662c89bb3bbc4920821 100644 (file)
@@ -17,9 +17,7 @@ bool SpawnPoint_Send(entity this, entity to, int sf)
        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;
 }
@@ -33,9 +31,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf)
        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)) )
index d426e2f610d3000c69c2b16cba9defb350adfb9f..5352b40cde1a8fa1afb3b6058d36a48a3ea0b6cf 100644 (file)
@@ -42,15 +42,11 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
 
        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);
                }