Skip to content

Commit

Permalink
Merge pull request CleverRaven#70478 from alef/70432-fix1
Browse files Browse the repository at this point in the history
Some Iterator Fixes for Crushing Leap
  • Loading branch information
Maleclypse authored Dec 28, 2023
2 parents faa3c3b + 0ea74c3 commit d1e85e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ void spell_effect::dash( const spell &sp, Creature &caster, const tripoint &targ
}
avatar *caster_you = caster.as_avatar();
auto walk_point = trajectory.begin();
if( *walk_point == source ) {
if( here.getlocal( *walk_point ) == source ) {
++walk_point;
}
// save the amount of moves the caster has so we can restore them after the dash
Expand All @@ -1654,7 +1654,9 @@ void spell_effect::dash( const spell &sp, Creature &caster, const tripoint &targ
if( caster_you != nullptr ) {
if( creatures.creature_at( here.getlocal( *walk_point ) ) ||
!g->walk_move( here.getlocal( *walk_point ), false ) ) {
--walk_point;
if( walk_point != trajectory.begin() ) {
--walk_point;
}
break;
} else {
sp.create_field( here.getlocal( *( walk_point - 1 ) ), caster );
Expand Down

0 comments on commit d1e85e0

Please sign in to comment.