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