Code: Select all
program control_Corpse(corpse)
if ( corpse.NPCTemplate() ) // If it's an NPC, this just returns 0
return 0;
endif
var settings := CP_GetSettingsCfgElem("Corpse");
var decay_wait := CInt(settings.CorpseDecay);
if ( !decay_wait )
return 0;
endif
Sleep(decay_wait);
corpse.SetDestroyable(1);
corpse.MakeRemains();
return 1;
endprogram[edit]Added the word "corpses" after NPC, for clarification.[/edit]