Skip to content

Commit

Permalink
Near-infinite loop fix for when crafter cannot continue (fixes #70530) (
Browse files Browse the repository at this point in the history
#73820)

* Near-infinite loop fix for when crafter cannot continue.

* Update src/activity_actor.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/activity_actor.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Draper, Daniel <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 18, 2024
1 parent 65c14e9 commit a61503f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3652,6 +3652,7 @@ void craft_activity_actor::do_turn( player_activity &act, Character &crafter )
const int assistants = crafter.available_assistant_count( craft.get_making() );

if( crafting_speed <= 0.0f ) {
craft.erase_var( "crafter" );
crafter.cancel_activity();
return;
}
Expand Down Expand Up @@ -3724,6 +3725,7 @@ void craft_activity_actor::do_turn( player_activity &act, Character &crafter )
if( !crafter.craft_consume_tools( craft, five_percent_steps, false ) ) {
// So we don't skip over any tool comsuption
craft.item_counter -= craft.item_counter % 500'000 + 1;
craft.erase_var( "crafter" );
crafter.cancel_activity();
return;
}
Expand Down

0 comments on commit a61503f

Please sign in to comment.