Jump to content

other_spiders filter in healer spider's DoHeal function shoule be wrong


royshen12
  • Pending

in prefabs\spider.lua, line 492, game version 490602

for i, spider in ipairs(other_spiders) do
	local target = inst.components.combat.target
	-- Don't heal the spider if it's targetting us, our leader or our leader's other followers
	local targetting_us = target ~= nil and
		(target == inst or (leader ~= nil and
    	(target == leader or leader.components.leader:IsFollower(target))))

seems wrong, should be like this

for i, spider in ipairs(other_spiders) do
	local target = spider.components.combat.target -- "target" should be this spider's target
	-- Don't heal the spider if it's targetting us / our leader / our leader's other followers
	local targetting_us =
        target ~= nil and
        (target == inst or -- this spider's target is me, that seems to make sense
        	(leader ~= nil and
        	(target == leader or -- this spider's target is leader
        	 leader.components.leader:IsFollower(target)) -- this spider's target is leader's other followers
    		)
  		)

 


Steps to Reproduce

code issue, no reproduce

  • Like 1



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...