From b98a83f7431c9d51ffccbc7e276c9d307bc9e54b Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Thu, 4 Feb 2016 17:57:51 +0100 Subject: [PATCH] Added string identifiers for terrain types. --- config/creatures/neutral.json | 2 +- lib/CHeroHandler.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/creatures/neutral.json b/config/creatures/neutral.json index ff4c68bcc..7f66d6988 100644 --- a/config/creatures/neutral.json +++ b/config/creatures/neutral.json @@ -480,7 +480,7 @@ "sandWalker" : { "type" : "NO_TERRAIN_PENALTY", - "subtype" : 1, + "subtype" : "terrain.sand", "propagator" : "HERO" } }, diff --git a/lib/CHeroHandler.cpp b/lib/CHeroHandler.cpp index 25c43d4a4..44f772375 100644 --- a/lib/CHeroHandler.cpp +++ b/lib/CHeroHandler.cpp @@ -284,6 +284,10 @@ CHeroHandler::CHeroHandler() } loadObstacles(); loadTerrains(); + for (int i = 0; i < GameConstants::TERRAIN_TYPES; ++i) + { + VLC->modh->identifiers.registerObject("core", "terrain", GameConstants::TERRAIN_NAMES[i], i); + } loadBallistics(); loadExperience(); }