From 1f4fc046f8e984290742da9389b9d413d55c5f46 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Wed, 30 Oct 2024 20:33:24 +0100 Subject: [PATCH] DEHACKED: warn if thing has MF_MISSILE without MF_NOBLOCKMAP Aftermath of https://github.com/fabiangreffrath/crispy-doom/issues/1076 --- src/doom/deh_thing.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/doom/deh_thing.c b/src/doom/deh_thing.c index 81820cde4c..5b62e17482 100644 --- a/src/doom/deh_thing.c +++ b/src/doom/deh_thing.c @@ -216,21 +216,33 @@ static void DEH_ThingParseLine(deh_context_t *context, char *line, void *tag) // all values are integers ivalue = atoi(value); - + // [crispy] support BEX bits mnemonics in Things fields - if (!ivalue && !strcasecmp(variable_name, "bits")) + if (!strcasecmp(variable_name, "bits")) { - for ( ; (value = strtok(value, ",+| \t\f\r")); value = NULL) - { - int i; - for (i = 0; i < arrlen(bex_thingbitstable); i++) - if (!strcasecmp(value, bex_thingbitstable[i].flag)) - { - ivalue |= bex_thingbitstable[i].bits; - break; - } - } + if (!ivalue) + { + for ( ; (value = strtok(value, ",+| \t\f\r")); value = NULL) + { + int i; + for (i = 0; i < arrlen(bex_thingbitstable); i++) + { + if (!strcasecmp(value, bex_thingbitstable[i].flag)) + { + ivalue |= bex_thingbitstable[i].bits; + break; + } + } + } + } + + if ((ivalue & (MF_NOBLOCKMAP | MF_MISSILE)) == MF_MISSILE) + { + DEH_Warning(context, "Thing %ld has MF_MISSILE without MF_NOBLOCKMAP", + (long)(mobj - mobjinfo) + 1); + } } + // [crispy] Thing ids in dehacked are 1-based, convert dropped item to 0-based if (!strcasecmp(variable_name, "dropped item")) {