Skip to content

Commit

Permalink
Potential fix for elemental knockout ending all caster spells.
Browse files Browse the repository at this point in the history
  • Loading branch information
luciensadi committed Jan 18, 2024
1 parent b5f7146 commit 9800816
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/newmagic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6896,7 +6896,8 @@ void _end_all_spells_of_type(int spell, int subtype, struct char_data *ch, bool
if (sust->spell == spell && (!subtype || sust->subtype == subtype)) {
// End the spell, then immediately loop again. There's a chance that the next spell in the list is our caster record, and we don't want to touch that since it's been deleted.
end_sustained_spell(ch, sust);
should_loop = TRUE;
// We only want to loop if this is _not_ an elemental, as elementals only conjure one spell but point back to the caster's spell list.
should_loop = !IS_PC_CONJURED_ELEMENTAL(ch);
break;
}
}
Expand Down Expand Up @@ -6925,7 +6926,8 @@ void end_all_caster_records(struct char_data *ch, bool keep_sustained_by_other)
if (!keep_sustained_by_other || !(sust->focus || sust->spirit)) {
// End the spell, then immediately loop again. There's a chance that the next spell in the list is our affect record, and we don't want to touch that since it's been deleted.
end_sustained_spell(ch, sust);
should_loop = TRUE;
// We only want to loop if this is _not_ an elemental, as elementals only conjure one spell but point back to the caster's spell list.
should_loop = !IS_PC_CONJURED_ELEMENTAL(ch);
break;
}
}
Expand Down

0 comments on commit 9800816

Please sign in to comment.