Skip to content

Commit

Permalink
DEHACKED: warn if thing has MF_MISSILE without MF_NOBLOCKMAP
Browse files Browse the repository at this point in the history
Aftermath of #1076
  • Loading branch information
fabiangreffrath committed Oct 30, 2024
1 parent f05294b commit 1f4fc04
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions src/doom/deh_thing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down

0 comments on commit 1f4fc04

Please sign in to comment.