diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index ec91fd54f..20277f12a 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -4775,12 +4775,14 @@ static void toggle_cf_flipping(int32_t sectnum, int32_t floorp) static const int16_t orient[8] = { 360, -360, -180, 180, -270, 270, 90, -90 }; - uint16_t *stat = &SECTORFLD(sectnum,stat, floorp); + const int32_t search = floorp ? SEARCH_FLOOR : SEARCH_CEILING; + + uint16_t *const stat = &SECTORFLD(sectnum,stat, floorp); int32_t i = *stat; i = (i&0x4)+((i>>4)&3); i = eitherSHIFT ? prev3[i] : next3[i]; - message("Sector %d %s flip %d deg%s", searchsector, typestr[searchstat], + message("Sector %d %s flip %d deg%s", sectnum, typestr[search], klabs(orient[i])%360, orient[i] < 0 ? " mirrored":""); i = (i&0x4)+((i&3)<<4); *stat &= ~0x34;