From 8c32a319ac3378e5c07f4d2cc34d671f5efdb1d1 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 24 Feb 2016 22:45:30 +0100 Subject: [PATCH] Server: Add terrain description to things_here command. --- server/commands.py | 3 +++ server/config/world_data.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/commands.py b/server/commands.py index 3717202..d002ab3 100644 --- a/server/commands.py +++ b/server/commands.py @@ -49,6 +49,9 @@ def command_thingshere(str_y, str_x): if None != y and None != x and y < length and x < length: pos = (y * world_db["MAP_LENGTH"]) + x strong_write(io_db["file_out"], "THINGS_HERE START\n") + terrain = chr(world_db["Things"][0]["T_MEMMAP"][pos]) + terrain_name = world_db["terrain_names"][terrain] + strong_write(io_db["file_out"], "terrain: " + terrain_name + "\n") if "v" == chr(world_db["Things"][0]["fovmap"][pos]): for id in [id for tid in sorted(list(world_db["ThingTypes"])) for id in world_db["Things"] diff --git a/server/config/world_data.py b/server/config/world_data.py index 97725a3..ec1e9b1 100644 --- a/server/config/world_data.py +++ b/server/config/world_data.py @@ -13,7 +13,13 @@ world_db = { "PLUGIN": [], "ThingActions": {}, "ThingTypes": {}, - "Things": {} + "Things": {}, + "terrain_names": { + " ": "UNKNOWN", + "X": "TREE", + "~": "SEA", + ".": "EARTH" + } } """Mapping of direction names to internal direction chars.""" -- 2.30.2