mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
[Bots] Prevent interrupt spam when OOM (#3011)
Notes: Bots currently do not do a mana check until the spell cast has already been started which results in an interrupt immediately after. If it is the last spell for a bot to cast, it tends to result in interrupt spam until the bot has enough mana. This will block the interrupt spam if the spell is invalid.
This commit is contained in:
parent
f030461bc7
commit
412eb5deaa
@ -1161,7 +1161,13 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid)
|
||||
if (bardsong) {
|
||||
spellid = bardsong;
|
||||
bard_song_mode = true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (IsBot() && !message && !color && !spellid) { // this is to prevent bots from spamming interrupts messages when trying to cast while OOM
|
||||
ZeroCastingVars(); // resets all the state keeping stuff
|
||||
LogSpells("Spell [{}] has been interrupted - Bot [{}] doesn't have enough mana", spellid, GetCleanName());
|
||||
return;
|
||||
}
|
||||
spellid = casting_spell_id;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user