- Edited
- Best Answerset by xRegnarokx
When move_turn() is called, either there aren't any nodes in the group "spaceships", or the array arr_ship[] hasn't been initialized yet. You could add a check:
if arr_ship.is_empty():
return
Also:
if arr_ship[i].active == true:
...
elif arr_ship[i].active != true:
...
can be simplified as:
if arr_ship[i].active:
...
else:
...
You could combine those two suggestions:
if not arr_ship.is_empty() and arr_ship[i].active:
...
else:
...