MattGibney / DarkThrone

Lovingly re-creating the DarkThrone experience.
https://darkthronereborn.com
1 stars 0 forks source link

Correctly calculate defence strength and round it down #25

Closed MattGibney closed 4 months ago

MattGibney commented 4 months ago

Issue was caused by the calculateDefenceStrength method on the player model. It was returning early rather than updating the defence number. This lead to a float being returned rather than passing through the other checks and returning at the end.

This also means that the defence stats weren't correctly being counted.


The test replicated an exact scenario causing the crash on production.

MattGibney commented 4 months ago

It shouldn't be the case that the app crashed on an unhandled exception. I'll raise a separate PR that covers this issue