From 47c31660caeb5f7502556fd100f5e575ddc9d61c Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 21 Nov 2011 00:01:12 +0100 Subject: [PATCH] minor script fixes - restored leach.lua 1.1.1 compatibility (entity_*TargetLeaches still works) - fixed possible script warning when picking up a collectible - made energy bariers ignore damage --- game_scripts/scripts/entities/energybarrier.lua | 1 + game_scripts/scripts/entities/leach.lua | 4 ++-- game_scripts/scripts/include/collectibletemplate.lua | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game_scripts/scripts/entities/energybarrier.lua b/game_scripts/scripts/entities/energybarrier.lua index 55d3898..1e98870 100644 --- a/game_scripts/scripts/entities/energybarrier.lua +++ b/game_scripts/scripts/entities/energybarrier.lua @@ -46,6 +46,7 @@ function v.commonInit(me) entity_setActivationType(me, AT_NONE) entity_setUpdateCull(me, 1024) entity_alpha(me, 0) + entity_setAllDamageTargets(me, false) end function update(me, dt) diff --git a/game_scripts/scripts/entities/leach.lua b/game_scripts/scripts/entities/leach.lua index 430d141..5b5b9ab 100644 --- a/game_scripts/scripts/entities/leach.lua +++ b/game_scripts/scripts/entities/leach.lua @@ -114,7 +114,7 @@ function enterState(me) elseif entity_getState(me)==STATE_ATTACHED then entity_setEntityType(me, ET_NEUTRAL) entity_setMaxSpeed(me, 0) - avatar_incrLeaches() + entity_incrTargetLeaches(me) entity_sound(me, "Leach") v.attachBone = entity_getNearestBoneToPosition(entity_getTarget(me), entity_getPosition(me)) --[[ @@ -132,7 +132,7 @@ end function exitState(me) if entity_getState(me)==STATE_ATTACHED then -- entity_setState(STATE_IDLE) - avatar_decrLeaches() + entity_decrTargetLeaches(me) elseif entity_isState(me, STATE_FLYOFF) then entity_setState(me, STATE_IDLE) end diff --git a/game_scripts/scripts/include/collectibletemplate.lua b/game_scripts/scripts/include/collectibletemplate.lua index 8367f0f..cef1121 100644 --- a/game_scripts/scripts/include/collectibletemplate.lua +++ b/game_scripts/scripts/include/collectibletemplate.lua @@ -43,7 +43,7 @@ function v.commonInit(me, gfx, flag, cst) v.back = true end - v.isCostume = cst + v.isCostume = cst or false end function v.commonUpdate(me, dt)