SERVER: Fix Soft_Restart not cleaning up barricades

This commit is contained in:
Steam Deck User 2023-03-06 18:09:43 -05:00
parent 3df23f64c1
commit 7d7c287292

View file

@ -86,6 +86,25 @@ void() GameRestart_CleanWallSummons =
} }
} }
//
// GameRestart_RepairBarricades()
// Resets the barricade health state.
//
void() GameRestart_RepairBarricades =
{
entity tempe;
tempe = find(world, classname, "window");
while (tempe != world) {
if (tempe.health != -10) {
tempe.health = 6;
tempe.frame = 0;
}
tempe = find(tempe, classname, "window");
}
}
//moto -- put this here because it keeps soft_restart somewhat clean.. //moto -- put this here because it keeps soft_restart somewhat clean..
void(entity door) reclose_door = { void(entity door) reclose_door = {
entity oldself; entity oldself;
@ -104,7 +123,7 @@ void(entity door) reclose_door = {
} }
void() Soft_Restart = { void() Soft_Restart = {
entity who, oldself, doors, box, revive, endgame, barricades; entity who, oldself, doors, box, revive, endgame;
self = find(world,classname,"player"); self = find(world,classname,"player");
oldself = self; oldself = self;
@ -134,17 +153,7 @@ void() Soft_Restart = {
GameRestart_CleanPowerUps(); GameRestart_CleanPowerUps();
GameRestart_CleanWallSummons(); GameRestart_CleanWallSummons();
GameRestart_RepairBarricades();
//repair all windows
barricades = find(world, classname, "item_barricade");
while(barricades != world) {
if (barricades.health != -10) {
barricades.health = 6;
barricades.frame = 0;
}
barricades = find(barricades, classname, "item_barricade");
}
//close doors //close doors
doors = findfloat(world, isopen, 1); doors = findfloat(world, isopen, 1);