MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / ClearSpellRecastTimer

Method ClearSpellRecastTimer

zone/bot.cpp:9284–9316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9282}
9283
9284void Bot::ClearSpellRecastTimer(uint16 spell_id)
9285{
9286 if (spell_id && !IsValidSpell(spell_id)) {
9287 OwnerMessage(
9288 fmt::format(
9289 "{} is not a valid spell ID.",
9290 spell_id
9291 )
9292 );
9293 return;
9294 }
9295
9296 if (!bot_timers.empty()) {
9297 for (int i = 0; i < bot_timers.size(); i++) {
9298 if (bot_timers[i].is_spell && bot_timers[i].timer_value >= Timer::GetCurrentTime()) {
9299 if (
9300 !spell_id ||
9301 (
9302 (
9303 spells[spell_id].timer_id != 0 &&
9304 spells[spell_id].timer_id == bot_timers[i].timer_id
9305 ) ||
9306 bot_timers[i].spell_id == spell_id
9307 )
9308 ) {
9309 bot_timers[i].timer_value = 0;
9310 }
9311 }
9312 }
9313 }
9314
9315 ClearExpiredTimers();
9316}
9317
9318
9319void Bot::ClearExpiredTimers()

Callers 3

InterruptSpellMethod · 0.45
bot_command_timerFunction · 0.45

Calls 3

IsValidSpellFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected