Error is in AllocateAoAs and happens because agents are being iterated over via their respective teams - however, they may be dead but still in a team. Therefore calling the function on dead agents which references a null pointer (to the agent).
Remove Agents from the respective Team struct upon death
Ensure agent is not in server's deadAgent map (see runTurn for similar already implemented)
Ensure that the last agent that a team was associated with remains in the agent's own data/structure, so that we can still associate them with the team in case they win (but died in the progress)
Error Description
Main branch fails to run.
Error is in
AllocateAoAs
and happens because agents are being iterated over via their respectiveteams
- however, they may be dead but still in a team. Therefore calling the function on dead agents which references a null pointer (to the agent).Fix Should
Team
struct upon deathdeadAgent
map (seerunTurn
for similar already implemented)