1 # This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
2 # or any later version. For details on its copyright, license, and warranties,
3 # see the file NOTICE in the root directory of the PlomRogue source package.
7 """Build Thing's FOV map."""
8 from server.config.world_data import world_db
9 from server.utils import libpr, c_pointer_to_bytearray
10 t["fovmap"] = bytearray(b'v' * (world_db["MAP_LENGTH"] ** 2))
11 fovmap = c_pointer_to_bytearray(t["fovmap"])
12 map = c_pointer_to_bytearray(world_db["MAP"])
13 if libpr.build_fov_map(t["T_POSY"], t["T_POSX"], fovmap, map):
14 raise RuntimeError("Malloc error in build_fov_Map().")