mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Fix for bot npctype memory leak (thanks mackal!)
This commit is contained in:
parent
c8645475b9
commit
444acb7c70
@ -30,6 +30,8 @@ extern volatile bool is_zone_loaded;
|
|||||||
|
|
||||||
// This constructor is used during the bot create command
|
// This constructor is used during the bot create command
|
||||||
Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) {
|
Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) {
|
||||||
|
GiveNPCTypeData(npcTypeData);
|
||||||
|
|
||||||
if(botOwner) {
|
if(botOwner) {
|
||||||
this->SetBotOwner(botOwner);
|
this->SetBotOwner(botOwner);
|
||||||
this->_botOwnerCharacterID = botOwner->CharacterID();
|
this->_botOwnerCharacterID = botOwner->CharacterID();
|
||||||
@ -108,6 +110,8 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
|
|||||||
Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData)
|
Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData)
|
||||||
: NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1)
|
: NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1)
|
||||||
{
|
{
|
||||||
|
GiveNPCTypeData(npcTypeData);
|
||||||
|
|
||||||
this->_botOwnerCharacterID = botOwnerCharacterID;
|
this->_botOwnerCharacterID = botOwnerCharacterID;
|
||||||
if(this->_botOwnerCharacterID > 0)
|
if(this->_botOwnerCharacterID > 0)
|
||||||
this->SetBotOwner(entity_list.GetClientByCharID(this->_botOwnerCharacterID));
|
this->SetBotOwner(entity_list.GetClientByCharID(this->_botOwnerCharacterID));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user