home · contact · privacy
Fix map geometry initialization bug.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 14 Dec 2020 23:39:00 +0000 (00:39 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 14 Dec 2020 23:39:00 +0000 (00:39 +0100)
rogue_chat_curses.py

index 65d5385ee2d20d17f5fb117a4ac82ea987163445..ff559246fe1cbdf22aec2879a41ecf3b7ab3777a 100755 (executable)
@@ -256,14 +256,14 @@ def cmd_MAP(game, geometry, size, content):
     map_geometry_class = globals()['MapGeometry' + geometry]
     game.map_geometry_new = map_geometry_class(size)
     game.map_content_new = content
     map_geometry_class = globals()['MapGeometry' + geometry]
     game.map_geometry_new = map_geometry_class(size)
     game.map_content_new = content
-    if type(game.map_geometry) == MapGeometrySquare:
+    if type(game.map_geometry_new) == MapGeometrySquare:
         game.tui.movement_keys = {
             game.tui.keys['square_move_up']: 'UP',
             game.tui.keys['square_move_left']: 'LEFT',
             game.tui.keys['square_move_down']: 'DOWN',
             game.tui.keys['square_move_right']: 'RIGHT',
         }
         game.tui.movement_keys = {
             game.tui.keys['square_move_up']: 'UP',
             game.tui.keys['square_move_left']: 'LEFT',
             game.tui.keys['square_move_down']: 'DOWN',
             game.tui.keys['square_move_right']: 'RIGHT',
         }
-    elif type(game.map_geometry) == MapGeometryHex:
+    elif type(game.map_geometry_new) == MapGeometryHex:
         game.tui.movement_keys = {
             game.tui.keys['hex_move_upleft']: 'UPLEFT',
             game.tui.keys['hex_move_upright']: 'UPRIGHT',
         game.tui.movement_keys = {
             game.tui.keys['hex_move_upleft']: 'UPLEFT',
             game.tui.keys['hex_move_upright']: 'UPRIGHT',