From bd6d14e565e56ed529a7f64a0ec8fb836d7fd1e4 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Thu, 16 Feb 2023 16:03:28 -0500 Subject: [PATCH] SERVER: Clean Wall Summons with Soft_Restart --- source/server/utilities/game_restart.qc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/server/utilities/game_restart.qc b/source/server/utilities/game_restart.qc index 63941f6..32f9bfe 100644 --- a/source/server/utilities/game_restart.qc +++ b/source/server/utilities/game_restart.qc @@ -67,6 +67,25 @@ void() GameRestart_CleanPowerUps = x2_finished = time; } +// +// GameRestart_CleanWallSummons() +// Removes World models summoned from +// weapon_wall. +// +void() GameRestart_CleanWallSummons = +{ + entity tempe; + + tempe = find(world, classname, "weapon_wall"); + while(tempe != world) { + // We store the world model with .enemy for.. some reason.. + if (tempe.enemy) + remove(tempe.enemy); + + tempe = find(tempe, classname, "weapon_wall"); + } +} + //moto -- put this here because it keeps soft_restart somewhat clean.. void(entity door) reclose_door = { entity oldself; @@ -114,6 +133,7 @@ void() Soft_Restart = { } GameRestart_CleanPowerUps(); + GameRestart_CleanWallSummons(); //repair all windows barricades = find(world, classname, "item_barricade");