From 886a53a0d95c53438a866a12d56aa84670c316ec Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 21 Feb 2021 22:03:24 +0100 Subject: [PATCH] Fix broken Assault destroy waypoints and bots ignoring explosive barrels (bugs introcuded by !501) --- qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc | 2 +- qcsrc/common/mapobjects/func/breakable.qc | 10 +++++----- qcsrc/common/mapobjects/func/breakable.qh | 2 +- qcsrc/server/cheats.qc | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc index 48d56d1f9..1492c6d06 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc +++ b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc @@ -366,7 +366,7 @@ spawnfunc(func_assault_destructible) else this.team = NUM_TEAM_1; - spawnfunc_func_breakable(this); + func_breakable_setup(this); } spawnfunc(func_assault_wall) diff --git a/qcsrc/common/mapobjects/func/breakable.qc b/qcsrc/common/mapobjects/func/breakable.qc index bf482b73a..ea71499fd 100644 --- a/qcsrc/common/mapobjects/func/breakable.qc +++ b/qcsrc/common/mapobjects/func/breakable.qc @@ -311,8 +311,7 @@ void func_breakable_reset(entity this) func_breakable_behave_restore(this); } -// destructible walls that can be used to trigger target_objective_decrease -spawnfunc(func_breakable) +void func_breakable_setup(entity this) { float n, i; if(!GetResource(this, RES_HEALTH)) @@ -382,7 +381,8 @@ spawnfunc(func_breakable) } // for use in maps with a "model" key set -spawnfunc(misc_breakablemodel) { - spawnfunc_func_breakable(this); -} +spawnfunc(misc_breakablemodel) { func_breakable_setup(this); } + +// destructible walls that can be used to trigger target_objective_decrease +spawnfunc(func_breakable) { func_breakable_setup(this); } #endif diff --git a/qcsrc/common/mapobjects/func/breakable.qh b/qcsrc/common/mapobjects/func/breakable.qh index 0efbcfaed..194603330 100644 --- a/qcsrc/common/mapobjects/func/breakable.qh +++ b/qcsrc/common/mapobjects/func/breakable.qh @@ -8,5 +8,5 @@ const int STATE_ALIVE = 0; const int STATE_BROKEN = 1; #ifdef SVQC -spawnfunc(func_breakable); +void func_breakable_setup(entity this); #endif diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 3506aa7b7..00b39fbe2 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -346,7 +346,7 @@ float CheatCommand(entity this, int argc) } else { - entity e = spawn(); + entity e = new(func_breakable); e.model = strzone(argv(1)); e.mdl = "rocket_explode"; SetResourceExplicit(e, RES_HEALTH, 1000); @@ -357,7 +357,7 @@ float CheatCommand(entity this, int argc) e.angles = fixedvectoangles2(trace_plane_normal, v_forward); e.angles = AnglesTransform_ApplyToAngles(e.angles, '-90 0 0'); // so unrotated models work } - spawnfunc_func_breakable(e); + func_breakable_setup(e); // now, is it valid? if(f == 0) { -- 2.39.2