From: Mario Date: Mon, 18 Mar 2013 14:57:55 +0000 (+1100) Subject: Fix player turret count increasing even if they're out of fuel X-Git-Tag: xonotic-v0.8.0~241^2^2~439 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5d3e2d23da7828172068e4f763e86e4342d31b6f;p=xonotic%2Fxonotic-data.pk3dir.git Fix player turret count increasing even if they're out of fuel --- diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index fe2941b78..0d8238ab2 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -258,6 +258,7 @@ float td_checkfuel(entity ent, string tur) void spawnturret(entity spawnedby, entity own, string turet, vector orig) { if not(IS_PLAYER(spawnedby)) { dprint("Warning: A non-player entity tried to spawn a turret\n"); return; } + if not(td_checkfuel(spawnedby, turet)) { return; } entity oldself; @@ -275,12 +276,12 @@ void spawnturret(entity spawnedby, entity own, string turet, vector orig) switch(turet) { - case "plasma": if not(td_checkfuel(spawnedby, turet)) return; spawnfunc_turret_plasma(); break; - case "mlrs": if not(td_checkfuel(spawnedby, turet)) return; spawnfunc_turret_mlrs(); break; - case "walker": if not(td_checkfuel(spawnedby, turet)) return; spawnfunc_turret_walker(); break; - case "flac": if not(td_checkfuel(spawnedby, turet)) return; spawnfunc_turret_flac(); break; - case "towerbuff": if not(td_checkfuel(spawnedby, turet)) return; spawnfunc_turret_fusionreactor(); break; - case "barricade": if not(td_checkfuel(spawnedby, turet)) return; spawn_barricade(); break; + case "plasma": spawnfunc_turret_plasma(); break; + case "mlrs": spawnfunc_turret_mlrs(); break; + case "walker": spawnfunc_turret_walker(); break; + case "flac": spawnfunc_turret_flac(); break; + case "towerbuff": spawnfunc_turret_fusionreactor(); break; + case "barricade": spawn_barricade(); break; default: Send_Notification(NOTIF_ONE, spawnedby, MSG_INFO, INFO_TD_INVALID); remove(self); self = oldself; return; }