Skip to content

Commit

Permalink
[Priest] Decouple death, taxes, and s2m
Browse files Browse the repository at this point in the history
Surrender to Madness kills the prices, which can occur in unfortunate
places in the simulator execution path. This commit moves the killing of
the actor to a discrete event that occurs on the same timestamp as the
"source event" that caused the death (i.e., out of insanity).

Fixes a rare(ish) crash where a mind-flay tick may trigger s2m death.
  • Loading branch information
navv1234 committed Aug 17, 2017
1 parent 49679a2 commit c470df0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions engine/class_modules/sc_priest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3674,13 +3674,15 @@ struct voidform_t final : public priest_buff_t<haste_buff_t>

if ( priest.buffs.surrender_to_madness->check() )
{
if ( sim->log )
{
sim->out_log.printf( "%s %s: Surrender to Madness kills you. You die. Horribly.", priest.name(), name() );
}
priest.demise();
priest.arise();
priest.buffs.surrender_to_madness_death->trigger();
make_event( sim, [ this ]() {
if ( sim->log )
{
sim->out_log.printf( "%s %s: Surrender to Madness kills you. You die. Horribly.", priest.name(), name() );
}
priest.demise();
priest.arise();
priest.buffs.surrender_to_madness_death->trigger();
} );
}

base_t::expire_override( expiration_stacks, remaining_duration );
Expand Down

0 comments on commit c470df0

Please sign in to comment.