No idea how to fix this error

i dont know how im supposed to fix this error:

Player 1 Errors:

Random seed: 4877006227868190628
---------------- Starting Your Algo --------------------
Configuring your custom algo strategy…
Performing turn 0 of your custom algo strategy
Traceback (most recent call last):
File “//algo_strategy.py”, line 312, in
algo.start()
File “/gamelib/algocore.py”, line 74, in start
self.on_turn(game_state_string)
File “//algo_strategy.py”, line 56, in on_turn
self.starter_strategy(game_state)
File “//algo_strategy.py”, line 86, in starter_strategy
game_state.attempt_spawn(INTERCEPTOR,location_options.remove(spawn_loc),1)
File “/gamelib/game_state.py”, line 374, in attempt_spawn
if type(locations[0]) == int:
TypeError: ‘NoneType’ object is not subscriptable

list.remove(item) returns None, not the updated list, so “locations” is unexpectedly None in attempt_spawn, causing the error.

1 Like