Jump to content

Merms are attacking chester.


lakhnish
  • Pending

Get chester.

Go to a merm. 

Chester gets killed. 

Your comments in the lua suggest that it's not supposed to happen.

return guy:HasTag("character") and not (guy:HasTag("merm") or has_merm_disguise) and 
           not (guy:HasTag("player") and (TheWorld.components.mermkingmanager and TheWorld.components.mermkingmanager:HasKing() ~= nil)) and 
           not (leader and leader:HasTag("player")) and 
           not (guy.components.follower and guy.components.follower.leader and -- Prevents merms from attacking chester
               (guy.components.follower.leader:HasTag("merm") or test_disguise(guy.components.follower.leader)) and not guy:HasTag("pig"))

 


Steps to Reproduce
Get chester. Go to a merm.  Chester gets killed. 



User Feedback


Didn't know this was a bug, thought the merms were just dicks attacking Chester, so hopefully Klei sees this and fixes it

Share this comment


Link to comment
Share on other sites

This is really annoying and since the comment suggests that merms are not supposed to attack chester, please fix their behaviour.

Share this comment


Link to comment
Share on other sites

@ScottHansen

From merm.lua

local function FindInvaderFn(guy, inst)

    local function test_disguise(test_guy)
        return test_guy.components.inventory and test_guy.components.inventory:EquipHasTag("merm")
    end

    local has_merm_disguise = test_disguise(guy)
    local leader = guy.components.follower and guy.components.follower.leader
	
    return (guy:HasTag("character") and not (guy:HasTag("merm") or has_merm_disguise)) and 
           not ((TheWorld.components.mermkingmanager and TheWorld.components.mermkingmanager:HasKing())) and 
           not (leader and leader:HasTag("player")) and 
           not (guy.components.follower and guy.components.follower.leader and -- Prevents merms from attacking chester
               (guy.components.follower.leader:HasTag("merm") or test_disguise(guy.components.follower.leader)) and not guy:HasTag("pig"))
end


According to Mobbstar:

 

Quote

ah, you see... Chesters leader is not the player, but rather the eyebone itself :D
And the eyebone never has the "merm" tag afaik

Fix suggestion by Zarklord:

    local leader = guy.components.follower and guy.components.follower.leader
	leader = leader and leader.components.inventoryitem:GetGrandOwner() or leader
Quote

That will mean that for inventory items it will test for the owner of the item.


I tried it and it worked. Wild merms did not attack chester anymore if you simply add this line for leader.
Please implement that.

  • Like 1

Share this comment


Link to comment
Share on other sites



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