]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/globalsound.qc
Make ReadVector/WriteVector more commonly used
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / globalsound.qc
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)