Skip to content

Commit

Permalink
[Mage] Icicle bugfix, part 12345.
Browse files Browse the repository at this point in the history
  • Loading branch information
navv1234 committed May 7, 2016
1 parent 38f4ecb commit 4286cec
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions engine/class_modules/sc_mage.cpp
Expand Up @@ -5106,7 +5106,11 @@ struct icicle_event_t : public event_t
new_s -> target = target;

mage -> icicle -> base_dd_min = mage -> icicle -> base_dd_max = state.first;
mage -> icicle -> schedule_execute( new_s );

// Immediately execute icicles so the correct damage is carried into the travelling icicle
// object.
mage -> icicle -> pre_execute_state = new_s;
mage -> icicle -> execute();

icicle_data_t new_state = mage -> get_icicle_object();
if ( new_state.first > 0 )
Expand Down Expand Up @@ -6901,6 +6905,12 @@ void mage_t::trigger_icicle( const action_state_t* trigger_state, bool chain, pl
return;

icicle_event = new ( *sim ) events::icicle_event_t( *this, d, icicle_target, true );

if ( sim -> debug )
sim -> out_debug.printf( "%s icicle use on %s%s, damage=%f, total=%u",
name(), icicle_target -> name(),
chain ? " (chained)" : "", d.first,
as<unsigned>( icicles.size() ) );
}
else if ( ! chain )
{
Expand All @@ -6913,14 +6923,18 @@ void mage_t::trigger_icicle( const action_state_t* trigger_state, bool chain, pl
actions::icicle_state_t* new_state = debug_cast<actions::icicle_state_t*>( icicle -> get_state() );
new_state -> target = icicle_target;
new_state -> source = d.second;
icicle -> schedule_execute( new_state );
}

if ( sim -> debug )
sim -> out_debug.printf( "%s icicle use on %s%s, damage=%f, total=%u",
name(), icicle_target -> name(),
chain ? " (chained)" : "", d.first,
as<unsigned>( icicles.size() ) );
// Immediately execute icicles so the correct damage is carried into the travelling icicle
// object.
icicle -> pre_execute_state = new_state;
icicle -> execute();

if ( sim -> debug )
sim -> out_debug.printf( "%s icicle use on %s%s, damage=%f, total=%u",
name(), icicle_target -> name(),
chain ? " (chained)" : "", d.first,
as<unsigned>( icicles.size() ) );
}
}

/* Report Extension Class
Expand Down

0 comments on commit 4286cec

Please sign in to comment.