Skip to content

Commit 51324ee

Browse files
authored
Merge pull request CleverRaven#83386 from inogenous/butchery-progress
Show progress percent when butchering
2 parents ca7c319 + 4df98bc commit 51324ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/activity_actor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9059,7 +9059,9 @@ bool butchery_activity_actor::initiate_butchery( player_activity &act, Character
90599059

90609060
if( !set_up_butchery( act, you, this_bd ) ) {
90619061
return false;
9062-
};
9062+
}
9063+
act.moves_total = to_moves<int>( this_bd.time_to_butcher );
9064+
act.moves_left = to_moves<int>( this_bd.time_to_butcher - this_bd.progress );
90639065
return true;
90649066
}
90659067

@@ -9147,6 +9149,9 @@ void butchery_activity_actor::do_turn( player_activity &act, Character &you )
91479149
}
91489150
} else {
91499151
this_bd->progress += 1_seconds;
9152+
// Uses max(1, ..) to prevent it going all the way to zero, which would stop the activity by the general `activity_actor` handling.
9153+
// Instead, the checks for `bd.empty()` will make sure to stop the activity by explicitly setting it to zero.
9154+
act.moves_left = std::max( 1, to_moves<int>( this_bd->time_to_butcher - this_bd->progress ) );
91509155
}
91519156
}
91529157

0 commit comments

Comments
 (0)