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

fix: handle skinning batch jobs correctly #4269

Merged
merged 1 commit into from
Feb 29, 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
16 changes: 13 additions & 3 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8235,9 +8235,19 @@ static void butcher_submenu( const std::vector<item *> &corpses, int corpse = -1
bool has_skin = false;
bool has_organs = false;

if( corpse != -1 ) {
const mtype *dead_mon = corpses[corpse]->get_mtype();
if( dead_mon ) {
// check if either the specific corpse has skin/organs or if any
// of the corpses do in case of a batch job
int i = 0;
for( const item * const &it : corpses ) {
// only interested in a specific corpse, skip the rest
if( corpse != -1 && corpse != i ) {
++i;
continue;
}
++i;

const mtype *dead_mon = it->get_mtype();
if( dead_mon != nullptr ) {
for( const harvest_entry &entry : dead_mon->harvest.obj() ) {
if( entry.type == "skin" ) {
has_skin = true;
Expand Down
Loading