Skip to content

Commit

Permalink
No ready_to_update boolean neessary anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonfmir committed Aug 22, 2017
1 parent 1e50d27 commit de96f02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 5 additions & 6 deletions aimmo-game/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ def client_ready(client_id):

def send_world_update():
for world_state in world_state_manager.values():
if world_state.ready_to_update:
socketio.emit(
'world-update',
world_state.get_updates(),
broadcast=True,
)
socketio.emit(
'world-update',
world_state.get_updates(),
broadcast=True,
)

@app.route('/')
def healthcheck():
Expand Down
4 changes: 1 addition & 3 deletions aimmo-game/simulation/world_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class WorldState():

def __init__(self, game_state):
self.game_state = game_state
self.ready_to_update = False
self.players = defaultdict(dict)
self.map_features = defaultdict(dict)
self.clear_updates()
Expand Down Expand Up @@ -101,7 +100,7 @@ def map_feature_dict(map_feature):
for player in game_state.avatar_manager.avatars:
self.update_player(player_dict(player))

main_avatar_id = 1 #game_state.main_avatar_id?
main_avatar_id = 1
avatar_view = game_state.avatar_manager.get_avatar(main_avatar_id).view
if avatar_view is None:
return
Expand All @@ -113,7 +112,6 @@ def map_feature_dict(map_feature):
# Creation
for cell in avatar_view.cells_to_reveal:
# There is an avatar.

if not cell.avatar is None:
self.create_player(player_dict(cell.avatar))
# Cell is an obstacle.
Expand Down

0 comments on commit de96f02

Please sign in to comment.