Currently we sometimes see underflow issues with PlayUpdate::num_tactics since the variable is an unsigned int. An example of this can be seen in #3226. Often the way this field is used is to subtract the number of tactics already initialized, and use the remaining value as the number of tactics to use for a specific part of the play. This could be problematic is (e.g.) num_tactics = 0 and we subtract it by 1, which would cause an underflow -> 0 - 1 = MAX_UINT
Acceptance criteria
[ ] Update PlayUpdate::num_tactics to signed int and update all usages in all plays to also use signed int, and not unsigned int
Description of the task
Currently we sometimes see underflow issues with
PlayUpdate::num_tactics
since the variable is anunsigned int
. An example of this can be seen in #3226. Often the way this field is used is to subtract the number of tactics already initialized, and use the remaining value as the number of tactics to use for a specific part of the play. This could be problematic is (e.g.)num_tactics = 0
and we subtract it by 1, which would cause an underflow ->0 - 1 = MAX_UINT
Acceptance criteria
PlayUpdate::num_tactics
to signed int and update all usages in all plays to also use signed int, and not unsigned int