]> 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 64275a357aaa216e28a34c528da312aaabd441dc..d001fe299dd835821f9815e59aed842b35e551eb 100644 (file)
@@ -76,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";
        }
@@ -88,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);