[V1.0] Pawn Given Work-Type Disabling Trait Can Still Be Assigned Work-Type

Started by O Negative, January 06, 2019, 03:24:41 PM

Previous topic - Next topic

O Negative

Circumstances: Vanilla (No Mods)

What Happened: Debug Tool - Give Trait was used to add a trait (Pyromaniac) to a pawn. The pawn was unable to fight fires, however the work settings allowed me (the player) to "check" firefighter as enabled.

What I Expected to Happen: A pawn that gains a trait should not be able to be assigned work types which are supposed to be disabled by said trait.

Steps to Reproduce:

  • Enable Dev-Mode
  • Load/New Game (Doesn't Matter)
  • Spawn colonists until you have at least one colonist who is capable of the firefighting work type
  • Use the dev-mode command to "Give trait..."
  • Select Pyromaniac
  • *Click* pawn to give trait
  • Open the pawn's bio tab
  • Note that the pawn's trait list has been updated, as has the "Incapable Of" list...
  • Open up the general work tab (bottom of screen)
  • Notice that the box to be assigned firefighting is still there and can be selected/deselected.

IMPORTANT NOTE:
If the gave is saved after the pawn has been given the trait, and then reloaded, the work settings seem to finally register the change, and the box is gone, as it should be.




This isn't such an issue for general gameplay, but this is a problem for modders such as myself who are looking for ways to effectively develop characters over a period of time :)

Kenneth

For adding trait at runtime with C# you can use the method TraitSet.GainTrait(Trait) which will update the disabled work types.
Turns out the debug tool did not call GainTrait but directly added the trait to the trait list, thus not updating the disabled work types.

I fixed the debug tool, thanks for reporting! ;)