zDiscord-Map-Pack/scripts/autoexec/InvincibleInv.cs

22 lines
645 B
C#
Raw Permalink Normal View History

2020-12-06 20:14:57 +00:00
// For Small Crossing Inventorys
// SimpleFlagArena also uses this
// Grants Invinciblity
package InvincibleInv
{
function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
{
%targetname = %targetObject.getDataBlock().getName();
//Used on some maps to make invs invincible
if( %targetObject.invincible && %targetname $= "StationInventory" )
return;
parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
}
};
//Prevent package from being activated if it is already
if (!isActivePackage(InvincibleInv))
activatePackage(InvincibleInv);