From 487e994f895a2a441ba835ba64c60bce628f01b3 Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 19 Dec 2018 05:36:48 -0500 Subject: [PATCH 1/2] Disabled zone map mmf option in cmake --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f3694698..11cc98802 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,10 +266,11 @@ IF(EQEMU_BUILD_LUA) ADD_DEFINITIONS(-DLUA_EQEMU) ENDIF(EQEMU_BUILD_LUA) -OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF) -IF(EQEMU_USE_MAP_MMFS) - ADD_DEFINITIONS(-DUSE_MAP_MMFS) -ENDIF(EQEMU_USE_MAP_MMFS) +#Disabled until reevaluation performed +#OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF) +#IF(EQEMU_USE_MAP_MMFS) +# ADD_DEFINITIONS(-DUSE_MAP_MMFS) +#ENDIF(EQEMU_USE_MAP_MMFS) SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.") From 8499c3e65d95492ae02cd4a06ddb1ab1e654377e Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 19 Dec 2018 07:11:59 -0500 Subject: [PATCH 2/2] Fix for conditional zone crashes caused by post-bot owner death hate aggregation (irongut_av) --- zone/attack.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index bb3d8cb2d..5c3d22c32 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2695,16 +2695,24 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b #ifdef BOTS // if other is a bot, add the bots client to the hate list - if (other->IsBot()) { - if (other->CastToBot()->GetBotOwner() && other->CastToBot()->GetBotOwner()->CastToClient()->GetFeigned()) { - AddFeignMemory(other->CastToBot()->GetBotOwner()->CastToClient()); + while (other->IsBot()) { + auto other_ = other->CastToBot(); + if (!other_ || !other_->GetBotOwner()) + break; + + auto owner_ = other_->GetBotOwner()->CastToClient(); + if (!owner_ || owner_->IsDead() || !owner_->InZone()) // added isdead and inzone checks to avoid issues in AddAutoXTarget(...) below + break; + + if (owner_->GetFeigned()) { + AddFeignMemory(owner_); } - else { - if (!hate_list.IsEntOnHateList(other->CastToBot()->GetBotOwner())) { - hate_list.AddEntToHateList(other->CastToBot()->GetBotOwner(), 0, 0, false, true); - other->CastToBot()->GetBotOwner()->CastToClient()->AddAutoXTarget(this); - } + else if (!hate_list.IsEntOnHateList(owner_)) { + hate_list.AddEntToHateList(owner_, 0, 0, false, true); + owner_->AddAutoXTarget(this); // this was being called on dead/out-of-zone clients } + + break; } #endif //BOTS @@ -2716,6 +2724,7 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b else { if (!hate_list.IsEntOnHateList(other->CastToMerc()->GetMercOwner())) hate_list.AddEntToHateList(other->CastToMerc()->GetMercOwner(), 0, 0, false, true); + // if mercs are reworked to include adding 'this' to owner's xtarget list, this should reflect bots code above } } //MERC @@ -5473,4 +5482,4 @@ int32 Mob::GetHPRegen() const int32 Mob::GetManaRegen() const { return mana_regen; -} \ No newline at end of file +}