Modified ZippZipp's bot name fix from the forums. Limited bot name length to fix a crash. Added Filter check too if you use the Name Filter.

This commit is contained in:
Natedog2012 committed 2015-05-28 11:48:03 -07:00
1 parent e5f979665d
commit 95243fd6ce
3 files changed
+23 -31

No files matched your search

+5 -5
View File
@@ -2071,6 +2071,11 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
return false;
}
if(Bot::IsBotNameAvailable((char*)name,&TempErrorMessage)) {
initiator->Message(0, "The name %s is already being used or is invalid. Please choose a different name.", (char*)name);
return false;
}
NPCType DefaultNPCTypeStruct = Bot::CreateDefaultNPCTypeStructForBot(name, lastname, level, race, botclass, gender);
Bot* NewBot = new Bot(DefaultNPCTypeStruct, initiator);
@@ -2086,11 +2091,6 @@ bool QuestManager::createBot(const char *name, const char *lastname, uint8 level
return false;
}
if(!NewBot->IsBotNameAvailable(&TempErrorMessage)) {
initiator->Message(0, "The name %s is already being used. Please choose a different name.", NewBot->GetCleanName());
return false;
}
if(!TempErrorMessage.empty()) {
initiator->Message(13, "Database Error: %s", TempErrorMessage.c_str());
return false;