CTristan / lobotomy-corporation-mods

Mods for Lobotomy Corporation
MIT License
5 stars 0 forks source link

Add bug fix for Crumbling Armor killing agent even though it was replaced #22

Closed CTristan closed 1 year ago

CTristan commented 1 year ago

There's a bug with Crumbling Armor where even though the gift was replaced with another gift in that slot it will still kill the agent if they perform Attachment work during the same day.

Steps to reproduce:

  1. Start the day with an agent that has Crumbling Armor's gift.
  2. Have the agent work on One Sin until the agent receives One Sin's gift, replacing Crumbling Armor's gift.
  3. Have the agent perform Attachment work on any abnormality.

Expected result: The agent should be able to perform the Attachment work without dying.

Actual result: The agent dies from Crumbling Armor's effect.

SabinStargem commented 1 year ago

I think someone said that you can replace the gift, but you had to end the day first. I am guessing that the script for armor's effect isn't derived from the gift itself, but rather applied to the workday?

CTristan commented 1 year ago

It's a bit weird, the abnormality has its own internal list of agents that gets loaded on day start and gets updated when an agent gets the gift, but due to a coding error agents don't get removed from the list when they replace the gift.

The proposed bug fix will essentially add a check that the agent actually has the gift equipped before killing the agent.