Skip to content

Commit 369b805

Browse files
committed
fix inverted butcher order
1 parent bf967d4 commit 369b805

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

docs/changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Template for new versions:
6767

6868
## Removed
6969

70-
# 50.13-r2
70+
# 50.13-r3
7171

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

9596
## Misc Improvements
9697
- `blueprint`: capture track carving designations in addition to already-carved tracks

plugins/autobutcher.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,19 @@ static void doMarkForSlaughter(df::unit *unit) {
216216
// returns true if a should be butchered before b
217217
static bool compareKids(df::unit *a, df::unit *b) {
218218
if (isHighPriority(a) != isHighPriority(b))
219-
return isHighPriority(a);
219+
return isHighPriority(b);
220220
if (Units::isDomesticated(a) != Units::isDomesticated(b))
221-
return Units::isDomesticated(b);
222-
return Units::getAge(a, true) < Units::getAge(b, true);
221+
return Units::isDomesticated(a);
222+
return Units::getAge(a, true) > Units::getAge(b, true);
223223
}
224224

225225
// returns true if a should be butchered before b
226226
static bool compareAdults(df::unit* a, df::unit* b) {
227227
if (isHighPriority(a) != isHighPriority(b))
228-
return isHighPriority(a);
228+
return isHighPriority(b);
229229
if (Units::isDomesticated(a) != Units::isDomesticated(b))
230-
return Units::isDomesticated(b);
231-
return Units::getAge(a, true) > Units::getAge(b, true);
230+
return Units::isDomesticated(a);
231+
return Units::getAge(a, true) < Units::getAge(b, true);
232232
}
233233

234234
struct WatchedRace {

0 commit comments

Comments
 (0)