From e2e17392762d125e300c53511f6cf26ff42b9823 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Sat, 25 Jun 2022 13:04:13 +0200 Subject: [PATCH] Fix a possible crash, if vehicles and turrets are disabled. Similar issue #2703 --- qcsrc/common/mutators/mutator/nades/nades.qc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 60faafe9ac..d215e9c8be 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -995,6 +995,9 @@ void nade_emerald_boom(entity this) { case 1: { + if(!autocvar_g_vehicles) + return; + if (vehspawncount < autocvar_g_nades_emerald_vehiclespawnlimit) { e = spawnvehicle( @@ -1009,6 +1012,9 @@ void nade_emerald_boom(entity this) true ); + if(!e) + return; // vehicle failed to be spawned + vehspawncount++; return; } @@ -1018,6 +1024,9 @@ void nade_emerald_boom(entity this) } case 2: { + if(!autocvar_g_turrets) + return; + if (turspawncount < autocvar_g_nades_emerald_turretspawnlimit) { e = spawnturret( @@ -1033,6 +1042,9 @@ void nade_emerald_boom(entity this) 1, true ); + + if(!e) + return; // turret failed to be spawned turspawncount++; return; -- 2.39.2