| 9282 | } |
| 9283 | |
| 9284 | void 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 | |
| 9319 | void Bot::ClearExpiredTimers() |
no test coverage detected