Skip to content

Commit 0ad1fd5

Browse files
authored
Merge pull request #4954 from myk002/myk_is_gay
[Units] fix regression in Units::isGay()
2 parents 6e9f689 + 91a40ba commit 0ad1fd5

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Template for new versions:
5757

5858
## Fixes
5959
- `preserve-rooms`: don't reserve a room for citizens that you expel from the fort
60+
- `autobutcher`: fix regression in ordering of butcherable animals
6061

6162
## Misc Improvements
6263

library/modules/Units.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ bool Units::isGay(df::unit *unit) {
312312
if (!unit->status.current_soul)
313313
return false;
314314

315-
auto &o_flag = unit->status.current_soul->orientation_flags;
316-
return (!isFemale(unit) || !(o_flag.bits.marry_male && o_flag.bits.romance_male))
317-
&& (!isMale(unit) || !(o_flag.bits.marry_female && o_flag.bits.romance_female));
315+
df::orientation_flags orientation = unit->status.current_soul->orientation_flags;
316+
return (!Units::isFemale(unit) || !(orientation.whole & (orientation.mask_marry_male | orientation.mask_romance_male)))
317+
&& (!Units::isMale(unit) || !(orientation.whole & (orientation.mask_marry_female | orientation.mask_romance_female)));
318318
}
319319

320320
bool Units::isNaked(df::unit *unit, bool no_items) {

plugins/autobutcher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static void doMarkForSlaughter(df::unit *unit) {
213213
unit->flags2.bits.slaughter = 1;
214214
}
215215

216-
// returns true if a should be butchered before b
216+
// returns true if b should be butchered before a
217217
static bool compareKids(df::unit *a, df::unit *b) {
218218
if (isHighPriority(a) != isHighPriority(b))
219219
return isHighPriority(b);
@@ -222,7 +222,7 @@ static bool compareKids(df::unit *a, df::unit *b) {
222222
return Units::getAge(a, true) > Units::getAge(b, true);
223223
}
224224

225-
// returns true if a should be butchered before b
225+
// returns true if b should be butchered before a
226226
static bool compareAdults(df::unit* a, df::unit* b) {
227227
if (isHighPriority(a) != isHighPriority(b))
228228
return isHighPriority(b);

0 commit comments

Comments
 (0)