mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Fix for bots ceasing combat when their 'follow me' mob dies
This commit is contained in:
parent
594ec4faee
commit
ee970acc2e
@ -20,6 +20,10 @@ Uleat: Added command 'profanity' (aliased 'prof')
|
||||
-- Quest failures and limited social interactions may alienate players if they become inhibiting
|
||||
-- System commands are allowed to be processed before redaction occurs in the 'say' channel
|
||||
- A longer list requires more clock cycles to process - so, try to keep them to the most offensible occurrences
|
||||
Uleat: Fix for bots ceasing combat when their 'follow me' mob dies
|
||||
- Bots will revert to their client leash owner (bot owner or client group leader) when their FollowID() mob is no longer valid
|
||||
- Combat will no longer be interrupted in these cases
|
||||
- Does not apply to bot owner death...
|
||||
|
||||
== 1/26/2019 ==
|
||||
Uleat: Fix for class Bot not honoring NPCType data reference
|
||||
|
||||
12
zone/bot.cpp
12
zone/bot.cpp
@ -2248,10 +2248,9 @@ void Bot::AI_Process() {
|
||||
|
||||
Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
|
||||
Group* bot_group = GetGroup();
|
||||
Mob* follow_mob = entity_list.GetMob(GetFollowID());
|
||||
|
||||
// Primary reasons for not processing AI
|
||||
if (!bot_owner || !bot_group || !follow_mob || !IsAIControlled())
|
||||
if (!bot_owner || !bot_group || !IsAIControlled())
|
||||
return;
|
||||
|
||||
if (bot_owner->IsDead()) {
|
||||
@ -2261,11 +2260,18 @@ void Bot::AI_Process() {
|
||||
return;
|
||||
}
|
||||
|
||||
// We also need a leash owner (subset of primary AI criteria)
|
||||
// We also need a leash owner and follow mob (subset of primary AI criteria)
|
||||
Client* leash_owner = (bot_group->GetLeader() && bot_group->GetLeader()->IsClient() ? bot_group->GetLeader()->CastToClient() : bot_owner);
|
||||
if (!leash_owner)
|
||||
return;
|
||||
|
||||
Mob* follow_mob = entity_list.GetMob(GetFollowID());
|
||||
|
||||
if (!follow_mob) {
|
||||
follow_mob = leash_owner;
|
||||
SetFollowID(leash_owner->GetID());
|
||||
}
|
||||
|
||||
// Berserk updates should occur if primary AI criteria are met
|
||||
if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
|
||||
if (!berserk && GetHP() > 0 && GetHPRatio() < 30.0f) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user