UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
47 stars 98 forks source link

Update `PlayUpdate::num_tactics` to be a signed integer #3228

Open nimazareian opened 2 weeks ago

nimazareian commented 2 weeks ago

Description of the task

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