Fix issue with getTargetNames who are lowerized

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent e0c4bcf4e0
commit bad68017b8
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -95,7 +95,7 @@ CAIAliasTranslator::~CAIAliasTranslator()
void CAIAliasTranslator::buildBotTree(const NLLIGO::IPrimitive* prim)
{
// look for bot nodes in the primitives
std::string value,name,aiClass;
std::string value, name, realName, aiClass;
if (prim->getPropertyByName("class",aiClass) )
{
if ( !nlstricmp(aiClass.c_str(),"npc_bot") ||!nlstricmp(aiClass.c_str(),"group_fauna") ||!nlstricmp(aiClass.c_str(),"npc_group") )
@ -117,6 +117,7 @@ void CAIAliasTranslator::buildBotTree(const NLLIGO::IPrimitive* prim)
nlwarning("<CAIAliasTranslator buildBotTree> errors : name='%s' alias='%s' in '%s'",name.c_str(),value.c_str(), buildPrimPath(prim).c_str());
}
realName = name;
NLMISC::strlwr(name);
//remove AI name parameters
string::size_type trash = name.find('$');
@ -128,7 +129,7 @@ void CAIAliasTranslator::buildBotTree(const NLLIGO::IPrimitive* prim)
{
if ( !nlstricmp(aiClass.c_str(),"npc_bot") )
{
_BotIdsToNames.insert( make_pair(id,name) );
_BotIdsToNames.insert( make_pair(id,realName) );
_BotNamesToIds.insert( make_pair(name,id) );
}
else

@ -625,7 +625,7 @@ class CMissionStepKillNpc : public IMissionStepTemplate
string name;
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(c->getAlias(), name);
if ( name == params[1] )
if ( NLMISC::strlwr(name) == NLMISC::strlwr(params[1]) )
{
user->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("kill_npc");

Loading…
Cancel
Save