When the active initiative actor is the last entry in the initiative and is removed, the turn order was not being updated accordingly, causing the internal initiative tracker to point to an undefined entry.
Attempts to advance/rewind initiative would fail as these do some sanity checks that were now failing.
This PR fixes the issue and also adds a sanity check to turn updating to catch faulty internal state and fix it.
When the active initiative actor is the last entry in the initiative and is removed, the turn order was not being updated accordingly, causing the internal initiative tracker to point to an undefined entry. Attempts to advance/rewind initiative would fail as these do some sanity checks that were now failing.
This PR fixes the issue and also adds a sanity check to turn updating to catch faulty internal state and fix it.