Skip to content

Commit

Permalink
fix inverted butcher order
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jul 4, 2024
1 parent bf967d4 commit 369b805
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Template for new versions:

## Removed

# 50.13-r2
# 50.13-r3

## New Tools
- `plant`: (reinstated) tool for creating/growing/removing plants
Expand All @@ -91,6 +91,7 @@ Template for new versions:
- `overlay`: overlay positions are now adjusted according to the configured max interface width percentage in the DF settings
- `zone`: animal assignment overlay button moved to not conflict with vanilla aquarium/terrarium button on glass cages
- `zone`: allow friendly creatures to be released from cages by assigning them to a pasture zone and then unassigning them
- `autobutcher`: fix inverted ranking of which animals to butcher first

## Misc Improvements
- `blueprint`: capture track carving designations in addition to already-carved tracks
Expand Down
12 changes: 6 additions & 6 deletions plugins/autobutcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,19 @@ static void doMarkForSlaughter(df::unit *unit) {
// returns true if a should be butchered before b
static bool compareKids(df::unit *a, df::unit *b) {
if (isHighPriority(a) != isHighPriority(b))
return isHighPriority(a);
return isHighPriority(b);
if (Units::isDomesticated(a) != Units::isDomesticated(b))
return Units::isDomesticated(b);
return Units::getAge(a, true) < Units::getAge(b, true);
return Units::isDomesticated(a);
return Units::getAge(a, true) > Units::getAge(b, true);
}

// returns true if a should be butchered before b
static bool compareAdults(df::unit* a, df::unit* b) {
if (isHighPriority(a) != isHighPriority(b))
return isHighPriority(a);
return isHighPriority(b);
if (Units::isDomesticated(a) != Units::isDomesticated(b))
return Units::isDomesticated(b);
return Units::getAge(a, true) > Units::getAge(b, true);
return Units::isDomesticated(a);
return Units::getAge(a, true) < Units::getAge(b, true);
}

struct WatchedRace {
Expand Down

0 comments on commit 369b805

Please sign in to comment.