Skip to content

Commit

Permalink
Fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Batiste Bieler committed Dec 18, 2009
1 parent 5cd1a90 commit e3df48e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chat/views.py
Expand Up @@ -102,8 +102,12 @@ def player_new(self, request):
def player_update_position(self, request):
key = request.COOKIES['rpg_key']
player = self.get_player(key)
player['position'] = simplejson.loads(request.POST['body'])
self.new_room_event(['update_player_position', [key, player['position']]])
pos = simplejson.loads(request.POST['body'])
player['position'] = pos
self.new_room_event([
'update_player_position',
[key, pos]
])
return json_response([1])

def message_new(self, request):
Expand Down Expand Up @@ -165,7 +169,7 @@ def change_room(self, request):
player['position'][1] = 28 * 16
y = -1
if direction == 'bottom':
player['position'] = 0
player['position'][1] = 0
y = +1
old_map = Map.objects.get(pk=self.pk)
room_map, created = Map.objects.get_or_create(x=old_map.x+x, y=old_map.y+y)
Expand Down

0 comments on commit e3df48e

Please sign in to comment.