Airship: modules delete themselves when airship is removed

Charles Spurrill 2012-11-12 18:09:58 -08:00
parent 08246163b7
commit f6b3790fed
2 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,13 @@ local parent;
protected func Initialize()
{
propanim = PlayAnimation("Flight", 5, Anim_Const(0), Anim_Const(1000));
AddEffect("CheckParent", this, 1, 1,this);
}
private func FxCheckParentTimer(object target, proplist, int timer)
{
if(!parent) target->RemoveObject();
else return;
}
//Moves the propeller 1 tick per call

View File

@ -2,6 +2,16 @@
local parent;
public func Initialize()
{
AddEffect("CheckParent", this,1,1,this);
}
private func FxCheckParentTimer(object target, proplist, int timer)
{
if(!parent) target->RemoveObject();
}
public func IsProjectileTarget(target,shooter) { return true; }
public func Damage(int change)