Adds a check to see if the cat already has the chosen injury before attempting to award it. Also adds a guard on that check to ensure that there is a possible injury in the pool for the cat - it throws a warning to the console if not and skips adding any injury, otherwise we'd be stuck in an endless loop forever.
Linked Issues
Fixes #2485
Proof of Testing
Before (test patrol awards scrapes as expected)
After (Paulina already has scrapes, this outcome should give scrapes but instead gives nothing as there is no other available option for Paulina to get).
Command line output:
If multiple injuries are in the pool, it will reroll until it gets something they don't have (I added bruises to this pool and now poor Paulina has those too)
Changelog/Credits
Bugfix: patrol correctly awards valid injuries to cats with pre-existing minor injuries
About The Pull Request
Adds a check to see if the cat already has the chosen injury before attempting to award it. Also adds a guard on that check to ensure that there is a possible injury in the pool for the cat - it throws a warning to the console if not and skips adding any injury, otherwise we'd be stuck in an endless loop forever.
Linked Issues
Fixes #2485
Proof of Testing
Before (test patrol awards scrapes as expected)![image](https://github.com/ClanGenOfficial/clangen/assets/48025294/fbe22791-3e65-4c3e-ab9e-208fe1aeb13b)
After (Paulina already has scrapes, this outcome should give scrapes but instead gives nothing as there is no other available option for Paulina to get).![image](https://github.com/ClanGenOfficial/clangen/assets/48025294/570c5d1c-06d8-4d7a-ba3b-abfc39595310)
Command line output:![image](https://github.com/ClanGenOfficial/clangen/assets/48025294/92e988f1-34fa-4271-9d71-aae45da4a072)
If multiple injuries are in the pool, it will reroll until it gets something they don't have (I added bruises to this pool and now poor Paulina has those too)![image](https://github.com/ClanGenOfficial/clangen/assets/48025294/6c25e57e-68a7-4e7c-8bfc-567fffa03741)
Changelog/Credits
Bugfix: patrol correctly awards valid injuries to cats with pre-existing minor injuries