Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying shaders to NPC's based on HasBuff causes Mod NPC's to also have the shader applied to them. #4

Open
alexwilk19 opened this issue Jan 31, 2022 · 0 comments

Comments

@alexwilk19
Copy link

Title says it all really, but heres a bit more detail, Code:
public override int NPCShader(NPC npc, SpriteBatch spriteBatch, Color drawColor)
{
if (npc.townNPC)
return base.NPCShader(npc, spriteBatch, drawColor);
var gnpc = npc.GetGlobalNPC();

        bool hasFoulSpirit = gnpc.DoT_Handler.Any(x => x.Type == ModContent.BuffType<FoulSpiritDebuff>());
        if (hasFoulSpirit)
            return 114;
        if (npc.HasBuff(ModContent.BuffType<NecroPoisonDebuff>()))
            return 67;
        
        return base.NPCShader(npc, spriteBatch, drawColor);
    }

Will cause my mod town NPC's to be affected by the same shader. I've checked to see if(npc.townNPC) is hit, it is. Shaders are still being applied to the wrong NPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant