Skip to content
Browse files

fixed bug with attempting to update a removed player

  • Loading branch information...
1 parent cdc856f commit b69f26ac1543d6b9637c77cb7ab1f14b34e7503b @MrJaba committed May 21, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 controllers/game_controller.rb
View
8 controllers/game_controller.rb
@@ -1,6 +1,6 @@
class GameController < Cramp::Controller::Websocket
- periodic_timer :push_states, :every => 0.1
- periodic_timer :push_bombs, :every => 0.1
+ periodic_timer :push_states, :every => 0.05
+ periodic_timer :push_bombs, :every => 0.05
periodic_timer :cleanup, :every => 1
on_data :receive_message
class << self
@@ -38,7 +38,9 @@ def receive_register(message, uuid=nil)
end
def receive_player_move(message, uuid)
- GameController.player_states[uuid].merge!({:x => message['data']['x'], :y => message['data']['y']}) unless uuid.nil?
+ if( uuid && GameController.player_states[uuid] )
+ GameController.player_states[uuid].merge!({:x => message['data']['x'], :y => message['data']['y']})
+ end
end
def receive_send_bomb_drop(message, uuid)

0 comments on commit b69f26a

Please sign in to comment.
Something went wrong with that request. Please try again.