This also makes enemies with negative perception scores give odd values - with higher stealth giving you worse ability to hide.
That's the bug report!
I submitted a fix here along with a refactor. I have a feeling this bug exists because this code is particularly confusing, so a refactor seemed appropriate.
https://github.com/TurningWheel/Barony/pull/805
https://github.com/TurningWheel/Barony/blob/33b568c8dff4baf3f178bd9afe6c790082c9ba05/src/entity.cpp#L895-L899
Evaluate this expression with minimum light (48) touch range (32) and stealth skill of zero. No observer or observer perception is zero
Evaluate with minimum light (48) touch range (32) and stealth skill of 100. No observer or observer perception is zero
This also makes enemies with negative perception scores give odd values - with higher stealth giving you worse ability to hide.
That's the bug report!
I submitted a fix here along with a refactor. I have a feeling this bug exists because this code is particularly confusing, so a refactor seemed appropriate. https://github.com/TurningWheel/Barony/pull/805