From: Mario Date: Wed, 17 Apr 2013 07:40:12 +0000 (+1000) Subject: Precache stuff X-Git-Tag: xonotic-v0.8.0~241^2^2~372 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=8af1deec77f85c166224b46724a7bfdb7a7fcfdc;p=xonotic%2Fxonotic-data.pk3dir.git Precache stuff --- diff --git a/qcsrc/server/generator.qc b/qcsrc/server/generator.qc index b14ee7f2e3..5a8e923daf 100644 --- a/qcsrc/server/generator.qc +++ b/qcsrc/server/generator.qc @@ -1,10 +1,13 @@ #ifdef CSQC +float generator_precached; + void generator_precache() { + if(generator_precached) + return; // already precached + precache_model("models/onslaught/generator.md3"); precache_model("models/onslaught/generator_dead.md3"); - precache_sound("onslaught/generator_underattack.wav"); - precache_model("models/onslaught/generator_dmg1.md3"); precache_model("models/onslaught/generator_dmg2.md3"); precache_model("models/onslaught/generator_dmg3.md3"); @@ -15,6 +18,8 @@ void generator_precache() precache_model("models/onslaught/generator_dmg8.md3"); precache_model("models/onslaught/generator_dmg9.md3"); precache_model("models/onslaught/generator_dead.md3"); + + generator_precached = TRUE; } void generator_draw() { } // TODO diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index e021076dbf..27a34c5fef 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -881,6 +881,7 @@ void spawnfunc_onslaught_generator() precache_sound("onslaught/ons_hit1.wav"); precache_sound("onslaught/ons_hit2.wav"); precache_sound("onslaught/electricity_explode.wav"); + precache_sound("onslaught/generator_underattack.wav"); if (!self.team) objerror("team must be set"); diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index c81a26c51d..917dbed5bc 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -124,6 +124,11 @@ void spawnfunc_td_generator() { if not(g_td) { remove(self); return; } + precache_sound("onslaught/generator_underattack.wav"); + precache_sound("onslaught/ons_hit1.wav"); + precache_sound("onslaught/ons_hit2.wav"); + precache_sound("weapons/rocket_impact.wav"); + gendestroyed = FALSE; if not(self.health)