forked from Mirrors/openclonk
add option to respawn rule to keep contents
parent
d0d27d25f1
commit
e5a9dd934f
|
@ -1,5 +1,14 @@
|
|||
/*-- Restart --*/
|
||||
|
||||
local remove_contents;
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
// Contents are removed
|
||||
remove_contents = true;
|
||||
return;
|
||||
}
|
||||
|
||||
public func Activate(int plr)
|
||||
{
|
||||
// Notify scenario.
|
||||
|
@ -10,7 +19,7 @@ public func Activate(int plr)
|
|||
if (clonk && clonk->GetCrewEnabled())
|
||||
{
|
||||
// Remove contents only if the Base Respawn Rule isn't there otherwise it will handle inventory
|
||||
if (!ObjectCount(Find_ID(Rule_BaseRespawn)))
|
||||
if (!ObjectCount(Find_ID(Rule_BaseRespawn)) && remove_contents)
|
||||
while (clonk->Contents())
|
||||
clonk->Contents()->RemoveObject();
|
||||
clonk->Kill(clonk, true);
|
||||
|
@ -18,5 +27,11 @@ public func Activate(int plr)
|
|||
}
|
||||
}
|
||||
|
||||
public func SetRemoveContents(bool do_removal)
|
||||
{
|
||||
remove_contents = do_removal;
|
||||
return;
|
||||
}
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
|
|
Loading…
Reference in New Issue