Vectorial1024/EliteBionicsFramework

Critical bug: wrong processing of hediff-added event

Closed this issue · 2 comments

A previous coding mistake has meant that the cached max HP was never updated even if new bionics were installed. This has created a lot of confusion.

I would like to apologize for not detecting this sooner and for the fact that this passed through into production for everyone to use, without anyone (including myself) being able to correctly identify what went wrong.

The techincal detail is that, by intention, whole body hediffs will not trigger max HP recalculation of the pawn because EBF specifically attaches info onto individual body parts; whole body hediffs simply does not have any body parts to attach info to. However, the mistake is that this was inverted: only whole body hediffs would trigger the recalculation, and then the cache got confused why it received a request to recalculate max HP from a whole-body hediff...

The effect was this:

  • No max HP update when a new EBF-powered body part is installed onto pawns (ie, shows wrong value)
  • Max HP will be correct after a save-load

Bugfix released.