Jump to content

Houndius Shootius stops attacking


chaosmonkey
  • Pending

Houndius Shootius frequently gives up attacking hounds if the hounds switch targets to the shootius and can't reach it. The hounds don't give up; they continue trying to attack the shootius, but the shootius just sits idle. This same phenomenon happens with frogs and all other creatures given the described behavior.

The fix to the issue is straightforward; the retarget function should target guys trying to attack players or shootius.

I've tested with the following patch, and it resolved the issue.

diff --git a/scripts/prefabs/eyeturret.lua b/scripts/prefabs/eyeturret.lua
index 7381673..1ce89ae 100644
--- a/scripts/prefabs/eyeturret.lua
+++ b/scripts/prefabs/eyeturret.lua
@@ -75,7 +75,7 @@ local function retargetfn(inst)

     return FindEntity(inst, TUNING.EYETURRET_RANGE + 3,
         function(guy)
-            return (playertargets[guy] or (guy.components.combat.target ~= nil and guy.components.combat.target:HasTag("player")))
+            return (playertargets[guy] or (guy.components.combat.target ~= nil and (guy.components.combat.target:HasTag("player") or guy.components.combat.target:HasTag("eyeturret"))))
                                        and inst.components.combat:CanTarget(guy)
         end,
         RETARGET_MUST_TAGS, --see entityreplica.lua

 


Steps to Reproduce

Reproducing with hounds:

spawn an eyeturret

put statues around it

spawn some hounds, agro them, and wait for them to switch to eyeturret and for eyeturret to give up

 

 

Reproducing with frogs:

spawn an eyeturret

put walls around it

spawn frogs, agro them, and let them switch to eyeturret. wait for eyeturret to give up.

 




User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...