]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix broken Assault destroy waypoints and bots ignoring explosive barrels (bugs introc...
authorterencehill <piuntn@gmail.com>
Sun, 21 Feb 2021 21:03:24 +0000 (22:03 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 21 Feb 2021 21:03:24 +0000 (22:03 +0100)
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc
qcsrc/common/mapobjects/func/breakable.qc
qcsrc/common/mapobjects/func/breakable.qh
qcsrc/server/cheats.qc

index 48d56d1f90a4b38b15ea8f02d1b8775c6b45e326..1492c6d06c6278147428dc2d79743be62e32b9ab 100644 (file)
@@ -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)
index bf482b73a2f9dc27fd9aea6c61a4620b49b74e99..ea71499fdb6b634bcbe2b9d381cc2a3a9534b238 100644 (file)
@@ -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
index 0efbcfaed5eb809c544d2f245d02467096b56ba7..19460333029600fa753ec45e0ee671308c0b559a 100644 (file)
@@ -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
index 3506aa7b799b9dc254cac14ac7ad09c71c4eaec6..00b39fbe2119ecdb8db1430380ce036c22025e05 100644 (file)
@@ -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)
                                        {