Skip to content

Commit

Permalink
Fix crash when repairing items (#51837)
Browse files Browse the repository at this point in the history
* Fix crash when repairing items

This was caused by #51600 which pops the current target if cannot_continue_repair is true.
However, this popped target is later used as fix_location (it's a reference set earlier).

This also fixes #51828 and #51674.

* Update src/activity_handlers.cpp

Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
  • Loading branch information
svenstaro and kevingranade committed Sep 24, 2021
1 parent fb48f34 commit c14e89d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,8 @@ void activity_handlers::repair_item_finish( player_activity *act, Character *you
const bool event_happened = attempt == repair_item_actor::AS_FAILURE ||
attempt == repair_item_actor::AS_SUCCESS ||
old_level != you->get_skill_level( actor->used_skill );
const bool can_refit = !destroyed && fix_location->has_flag( flag_VARSIZE ) &&
const bool can_refit = !destroyed && !cannot_continue_repair &&
fix_location->has_flag( flag_VARSIZE ) &&
!fix_location->has_flag( flag_FIT );

const bool need_input =
Expand Down

0 comments on commit c14e89d

Please sign in to comment.