Merge branch 'master' into movement_manager

This commit is contained in:
Akkadius 2018-12-30 14:49:59 -06:00
commit 4e24184089
2 changed files with 23 additions and 13 deletions

View File

@ -266,10 +266,11 @@ IF(EQEMU_BUILD_LUA)
ADD_DEFINITIONS(-DLUA_EQEMU) ADD_DEFINITIONS(-DLUA_EQEMU)
ENDIF(EQEMU_BUILD_LUA) ENDIF(EQEMU_BUILD_LUA)
OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF) #Disabled until reevaluation performed
IF(EQEMU_USE_MAP_MMFS) #OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF)
ADD_DEFINITIONS(-DUSE_MAP_MMFS) #IF(EQEMU_USE_MAP_MMFS)
ENDIF(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.") SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.")

View File

@ -2689,16 +2689,24 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
#ifdef BOTS #ifdef BOTS
// if other is a bot, add the bots client to the hate list // if other is a bot, add the bots client to the hate list
if (other->IsBot()) { while (other->IsBot()) {
if (other->CastToBot()->GetBotOwner() && other->CastToBot()->GetBotOwner()->CastToClient()->GetFeigned()) { auto other_ = other->CastToBot();
AddFeignMemory(other->CastToBot()->GetBotOwner()->CastToClient()); 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 { else if (!hate_list.IsEntOnHateList(owner_)) {
if (!hate_list.IsEntOnHateList(other->CastToBot()->GetBotOwner())) { hate_list.AddEntToHateList(owner_, 0, 0, false, true);
hate_list.AddEntToHateList(other->CastToBot()->GetBotOwner(), 0, 0, false, true); owner_->AddAutoXTarget(this); // this was being called on dead/out-of-zone clients
other->CastToBot()->GetBotOwner()->CastToClient()->AddAutoXTarget(this);
}
} }
break;
} }
#endif //BOTS #endif //BOTS
@ -2710,6 +2718,7 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
else { else {
if (!hate_list.IsEntOnHateList(other->CastToMerc()->GetMercOwner())) if (!hate_list.IsEntOnHateList(other->CastToMerc()->GetMercOwner()))
hate_list.AddEntToHateList(other->CastToMerc()->GetMercOwner(), 0, 0, false, true); 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 } //MERC