Hot Ice: Fix movement/fire carrying over from previous round

liquid_container
Lukas Werling 2016-04-06 21:18:13 +02:00
parent d0c800d27a
commit 0d21b0b12d
1 changed files with 11 additions and 2 deletions

View File

@ -21,8 +21,8 @@ func Initialize()
func ResetRound()
{
// Retrieve all Clonks.
var clonks = FindObjects(Find_OCF(OCF_CrewMember));
for (var clonk in clonks)
var clonks = [];
for (var clonk in FindObjects(Find_OCF(OCF_CrewMember)))
{
var container = clonk->Contained();
if (container)
@ -30,6 +30,15 @@ func ResetRound()
clonk->Exit();
container->RemoveObject();
}
else
{
// Players not waiting for a relaunch get a new Clonk to prevent
// status effects from carrying over to the next round.
var new_clonk = CreateObject(clonk->GetID(), 0, 0, clonk->GetOwner());
new_clonk->GrabObjectInfo(clonk);
clonk = new_clonk;
}
PushBack(clonks, clonk);
clonk->SetObjectStatus(C4OS_INACTIVE);
}
// Clear and redraw the map.