mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
[Bug Fix] Clear Ramp when Clearing hate (#3892)
* [Bug Fix] Clear Ramp when Clearing hate When clearing a client from the hatelist, also clear them from ramp * Add additional calls missed * requested changes * extra tabs
This commit is contained in:
+37
-1
@@ -778,6 +778,7 @@ void Client::AI_Process()
|
||||
|
||||
if (GetTarget()->IsCorpse()) {
|
||||
RemoveFromHateList(this);
|
||||
RemoveFromRampageList(this);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1089,6 +1090,7 @@ void Mob::AI_Process() {
|
||||
|
||||
if (target->IsCorpse()) {
|
||||
RemoveFromHateList(this);
|
||||
RemoveFromRampageList(this);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2062,6 +2064,32 @@ void Mob::ClearRampage()
|
||||
RampageArray.clear();
|
||||
}
|
||||
|
||||
void Mob::RemoveFromRampageList(Mob* mob, bool remove_feigned)
|
||||
{
|
||||
if (!mob) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
IsNPC() &&
|
||||
GetSpecialAbility(SPECATK_RAMPAGE) &&
|
||||
(
|
||||
remove_feigned ||
|
||||
mob->IsNPC() ||
|
||||
(
|
||||
mob->IsClient() &&
|
||||
!mob->CastToClient()->GetFeigned()
|
||||
)
|
||||
)
|
||||
) {
|
||||
for (int i = 0; i < RampageArray.size(); i++) {
|
||||
if (mob->GetID() == RampageArray[i]) {
|
||||
RampageArray[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Mob::Rampage(ExtraAttackOptions *opts)
|
||||
{
|
||||
int index_hit = 0;
|
||||
@@ -2083,8 +2111,16 @@ bool Mob::Rampage(ExtraAttackOptions *opts)
|
||||
// range is important
|
||||
Mob *m_target = entity_list.GetMob(RampageArray[i]);
|
||||
if (m_target) {
|
||||
if (m_target == GetTarget())
|
||||
if (m_target == GetTarget()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_target->IsCorpse()) {
|
||||
LogAggroDetail("[{}] is on [{}]'s rampage list", m_target->GetCleanName(), GetCleanName());
|
||||
RemoveFromRampageList(m_target, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (DistanceSquaredNoZ(GetPosition(), m_target->GetPosition()) <= NPC_RAMPAGE_RANGE2) {
|
||||
ProcessAttackRounds(m_target, opts);
|
||||
index_hit++;
|
||||
|
||||
Reference in New Issue
Block a user