From: Freddy Date: Wed, 7 Mar 2018 16:55:12 +0000 (+0100) Subject: Minor cleanup for func_plat X-Git-Tag: xonotic-v0.8.5~2176^2~36 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2c36cc4e3b4a2d70f740d64eb82998db692394f2;p=xonotic%2Fxonotic-data.pk3dir.git Minor cleanup for func_plat --- diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index d3f9587b8..00d4f78d2 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -58,15 +58,19 @@ void plat_link(entity this) spawnfunc(func_plat) { - if (this.sounds == 0) this.sounds = 2; - if (this.spawnflags & PLAT_CRUSH) { this.dmg = 10000; } - if (this.dmg && (this.message == "")) this.message = "was squished"; - if (this.dmg && (this.message2 == "")) this.message2 = "was squished by"; + if (this.dmg && (this.message == "")) + { + this.message = "was squished"; + } + if (this.dmg && (this.message2 == "")) + { + this.message2 = "was squished by"; + } if (this.sounds == 1) { @@ -80,13 +84,20 @@ spawnfunc(func_plat) this.noise1 = "plats/medplat2.wav"; } + // WARNING: backwards compatibility because people don't use already existing fields :( if (this.sound1) this.noise = this.sound1; if (this.sound2) this.noise1 = this.sound2; - if(this.noise && this.noise != "") { precache_sound(this.noise); } - if(this.noise1 && this.noise1 != "") { precache_sound(this.noise1); } + if(this.noise && this.noise != "") + { + precache_sound(this.noise); + } + if(this.noise1 && this.noise1 != "") + { + precache_sound(this.noise1); + } this.mangle = this.angles; this.angles = '0 0 0'; diff --git a/qcsrc/common/triggers/platforms.qc b/qcsrc/common/triggers/platforms.qc index 83664cc44..7acdc614e 100644 --- a/qcsrc/common/triggers/platforms.qc +++ b/qcsrc/common/triggers/platforms.qc @@ -173,6 +173,8 @@ void plat_use(entity this, entity actor, entity trigger) plat_go_down(this); } +// WARNING: backwards compatibility because people don't use already existing fields :( +// TODO: Check if any maps use these fields and remove these fields if it doesn't break maps .string sound1, sound2; void plat_reset(entity this)