From be5dc2d4a4511335b3e1e07e6a69c9a8418bf8da Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Thu, 9 Jan 2020 14:48:30 -0600 Subject: [PATCH] Make Units::isGay act consistently when called on an asexual unit. The function appears to be used to determine whether heterosexual relationships are possible, so asexual units will always return true for isGay. Old behavior was to treat asexual units as male. --- library/modules/Units.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index 861c25ce9..b2dd7b679 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -1549,8 +1549,8 @@ bool Units::isGay(df::unit* unit) if (!unit->status.current_soul) return false; df::orientation_flags orientation = unit->status.current_soul->orientation_flags; - return (Units::isFemale(unit) && ! (orientation.whole & (orientation.mask_marry_male | orientation.mask_romance_male))) - || (!Units::isFemale(unit) && ! (orientation.whole & (orientation.mask_marry_female | orientation.mask_romance_female))); + return (!Units::isFemale(unit) || !(orientation.whole & (orientation.mask_marry_male | orientation.mask_romance_male))) + && (!Units::isMale(unit) || !(orientation.whole & (orientation.mask_marry_female | orientation.mask_romance_female))); } bool Units::isNaked(df::unit* unit)