From 0cdbc66c02a5b9b644abd98509a586e9f42eb7fd Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 14 Mar 2012 01:00:46 +0100 Subject: [PATCH] Minor script fixes - Bigmouth & Grabbyarm will no longer spam "entity invalid pointer" - Make Huggys follow through local warps (thx to Andrew Church for this) --- game_scripts/scripts/entities/bigmouth.lua | 2 +- game_scripts/scripts/entities/grabbyarm.lua | 2 +- game_scripts/scripts/entities/huggy.lua | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game_scripts/scripts/entities/bigmouth.lua b/game_scripts/scripts/entities/bigmouth.lua index 97f45ac..beb276e 100644 --- a/game_scripts/scripts/entities/bigmouth.lua +++ b/game_scripts/scripts/entities/bigmouth.lua @@ -174,7 +174,7 @@ function hitSurface(me) end function damage(me, attacker, bone, damageType, dmg) - if v.parasite and bone_isName(bone,"Parasite") then + if v.parasite and bone ~= 0 and bone_isName(bone,"Parasite") then bone_damageFlash(bone) v.paraHits = v.paraHits - dmg if v.paraHits <= 0 then diff --git a/game_scripts/scripts/entities/grabbyarm.lua b/game_scripts/scripts/entities/grabbyarm.lua index bc486f2..792002d 100644 --- a/game_scripts/scripts/entities/grabbyarm.lua +++ b/game_scripts/scripts/entities/grabbyarm.lua @@ -123,7 +123,7 @@ function update(me, dt) v.grabbedEnt = v.n entity_setState(me, STATE_TRAP) - elseif entity_isEntityInRange(me, v.li, grabRange) then + elseif v.li ~= 0 and entity_isEntityInRange(me, v.li, grabRange) then v.grabbedEnt = v.li entity_setState(me, STATE_TRAP) diff --git a/game_scripts/scripts/entities/huggy.lua b/game_scripts/scripts/entities/huggy.lua index e896afa..bf87dc6 100644 --- a/game_scripts/scripts/entities/huggy.lua +++ b/game_scripts/scripts/entities/huggy.lua @@ -206,11 +206,13 @@ function enterState(me) esetv(me, EV_LOOKAT,1) entity_animate(me, "idle", LOOP_INF) entity_setMaxSpeed(me, 400) + entity_setUpdateCull(me, 1500) elseif entity_getState(me)==STATE_ATTACHED then entity_setEntityType(me, ET_NEUTRAL) esetv(me, EV_LOOKAT,0) entity_setMaxSpeed(me, 0) + entity_setUpdateCull(me, -1) entity_animate(me, "attached", LOOP_INF) entity_sound(me, "Leach") v.attachBone = entity_getNearestBoneToPosition(entity_getTarget(me), entity_getPosition(me))