Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break recursive death spiral #74315

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,9 @@ bool avatar::cant_see( const tripoint_bub_ms &p )

void avatar::rebuild_aim_cache()
{
aim_cache_dirty =
false; // Can trigger recursive death spiral if still set when calc_steadiness is called.

double pi = 2 * acos( 0.0 );

const tripoint local_last_target = get_map().bub_from_abs( last_target_pos.value() ).raw();
Expand Down Expand Up @@ -1311,7 +1314,6 @@ void avatar::rebuild_aim_cache()
}

// set cache as no longer dirty
aim_cache_dirty = false;
}

void avatar::set_movement_mode( const move_mode_id &new_mode )
Expand Down
Loading