]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/func/plat.qc
Support custom func_door and func_plat sounds on Q3A maps
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / func / plat.qc
index 4e4aa632ba7e562eda844200f371d15d2a1d4c38..23b9eb5b1725eee170cfd1ab7ab5c020bca102b3 100644 (file)
@@ -98,14 +98,28 @@ spawnfunc(func_plat)
 
        if (q3compat)
        {
-               // CPMA adds these fields for overriding the engine sounds
+               // CPMA adds these fields for overriding the Q3 default sounds
                string s = GetField_fullspawndata(this, "sound_start", true);
                string e = GetField_fullspawndata(this, "sound_end", true);
 
                if (s)
                        this.noise = strzone(s);
+               else
+               {
+                       // PK3s supporting Q3A sometimes include custom sounds at Q3 default paths
+                       s = "sound/movers/plats/pt1_strt.wav";
+                       if (FindFileInMapPack(s))
+                               this.noise = s;
+               }
+
                if (e)
                        this.noise1 = strzone(e);
+               else
+               {
+                       e = "sound/movers/plats/pt1_end.wav";
+                       if (FindFileInMapPack(e))
+                               this.noise1 = e;
+               }
        }
 
        if(this.noise && this.noise != "")