home · contact · privacy
Fix bug that blocked sound from reaching players.
[plomrogue2] / plomrogue / commands.py
index c25740bd98f93d174b6f4312147abfa448761052..a92359eac8c2fcab197ea9ea42d2cd2de72b9a40 100644 (file)
@@ -44,7 +44,8 @@ def cmd_ALL(game, msg, connection_id):
     if not speaker:
         raise GameError('need to be logged in for this')
     largest_audible_distance = 20
-    dijkstra_map = DijkstraMap(game.things, game.maps, speaker.position,
+    things = [t for t in game.things if t.type_ != 'Player']
+    dijkstra_map = DijkstraMap(things, game.maps, speaker.position,
                                largest_audible_distance, game.get_map)
     for c_id in game.sessions:
         listener = game.get_player(c_id)
@@ -310,3 +311,14 @@ def cmd_GOD_THING_PROTECTION(game, thing_id, protection_char):
         raise GameError('thing of ID %s not found' % thing_id)
     t.protection = protection_char
 cmd_GOD_THING_PROTECTION.argtypes = 'int:pos char'
+
+def cmd_THING_DOOR_CLOSED(game, thing_id):
+    t = game.get_thing(thing_id)
+    if not t:
+        raise GameError('thing of ID %s not found' % thing_id)
+    if not t.type_ == 'Door':
+        raise GameError('thing of ID %s not door' % thing_id)
+    t.blocking = True
+    t.portable = False
+    t.thing_char = '#'
+cmd_THING_DOOR_CLOSED.argtypes = 'int:pos'