]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/plat.qc
Resolve conflicts 1: Merge commit 'c58baab5' into bones_was_here/q3compat
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / plat.qc
index 53dbed02fa42a50580b69efe7ef80143ba0b0f5e..d001fe299dd835821f9815e59aed842b35e551eb 100644 (file)
@@ -31,9 +31,7 @@ float plat_send(entity this, entity to, float sf)
 
                WriteVector(MSG_ENTITY, this.size);
 
-               WriteAngle(MSG_ENTITY, this.mangle_x);
-               WriteAngle(MSG_ENTITY, this.mangle_y);
-               WriteAngle(MSG_ENTITY, this.mangle_z);
+               WriteAngleVector(MSG_ENTITY, this.mangle);
 
                WriteShort(MSG_ENTITY, this.speed);
                WriteShort(MSG_ENTITY, this.height);
@@ -78,8 +76,9 @@ spawnfunc(func_plat)
                this.noise1 = "plats/plat2.wav";
        }
 
-       if (this.sounds == 2)
+       if (this.sounds == 2 || q3compat)
        {
+               // Plats in Q3 always have sounds (they're hard coded in Q3 engine)
                this.noise = "plats/medplat1.wav";
                this.noise1 = "plats/medplat2.wav";
        }
@@ -90,6 +89,18 @@ spawnfunc(func_plat)
        if (this.sound2)
                this.noise1 = this.sound2;
 
+       if (q3compat)
+       {
+               // CPMA adds these fields for overriding the engine sounds
+               string s = GetField_fullspawndata(this, "sound_start", true);
+               string e = GetField_fullspawndata(this, "sound_end", true);
+
+               if (s)
+                       this.noise = strzone(s);
+               if (e)
+                       this.noise1 = strzone(e);
+       }
+
        if(this.noise && this.noise != "")
        {
                precache_sound(this.noise);
@@ -152,9 +163,7 @@ NET_HANDLE(ENT_CLIENT_PLAT, bool isnew)
 
                this.size = ReadVector();
 
-               this.mangle_x = ReadAngle();
-               this.mangle_y = ReadAngle();
-               this.mangle_z = ReadAngle();
+               this.mangle = ReadAngleVector();
 
                this.speed = ReadShort();
                this.height = ReadShort();