always make sure the name prefix has an underscore at the end of it.

develop
Japa Illo 2017-02-07 11:09:39 +05:30
parent f9b296884c
commit b151ad7c75
1 changed files with 5 additions and 1 deletions

@ -16,7 +16,7 @@ using namespace DFHack;
DFHACK_PLUGIN("generated-creature-renamer");
REQUIRE_GLOBAL(world);
#define RENAMER_VERSION 2
#define RENAMER_VERSION 3
command_result list_creatures(color_ostream &out, std::vector <std::string> & parameters);
@ -147,6 +147,10 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
descriptor[j] = toupper(descriptor[j]);
}
auto prefix = prefixes[prefixIndex];
if (prefix[prefix.length() - 1] != '_')
prefix.append("_");
creatureRaw->creature_id = prefixes[prefixIndex] + descriptor;
if (descriptorCount[foundIndex] > 0)