Exemplo n.º 1
0
    def validate_maps():
        if not config.Server.Settings.use_map_tiles:
            return True

        if not MapTile.validate_version():
            return False

        return True
Exemplo n.º 2
0
    def load_map_tiles(map_id, x, y):
        if not config.Server.Settings.use_map_tiles:
            return

        if map_id not in MAP_LIST:
            return

        x = MapManager.get_tile_x(x)
        y = MapManager.get_tile_y(y)

        for i in range(-1, 1):
            for j in range(-1, 1):
                if -1 < x + i < 64 and -1 < y + j < 64:
                    # Avoid loading tiles information if we already did.
                    if not MAPS[map_id].tiles_used[x + i][y + j]:
                        MAPS[map_id].tiles_used[x + i][y + j] = True
                        MAPS[map_id].tiles[x + i][y + j] = MapTile(
                            map_id, x + i, y + j)