- translate UMAPINFO specials at execution time, not load time.

At load time the context for translation does not exist.
This commit is contained in:
Christoph Oelckers 2019-01-27 16:09:05 +01:00
parent 73696e2781
commit c8cd11422a
2 changed files with 17 additions and 9 deletions

View file

@ -3087,8 +3087,20 @@ void A_BossDeath(AActor *self)
}
checked = true;
P_ExecuteSpecial(sa->Action, NULL, self, false,
sa->Args[0], sa->Args[1], sa->Args[2], sa->Args[3], sa->Args[4]);
if (sa->Action & 0x40000000)
{
// This is a Doom format special from UMAPINFO. It must be translated here, because at parsing time there is not sufficient context to do it.
maplinedef_t ml;
ml.special = sa->Action & 0x3fffffff;
ml.tag = sa->Args[0];
line_t line;
self->Level->TranslateLineDef(&line, &ml);
P_ExecuteSpecial(line.special, NULL, self, false, line.args[0], line.args[1], line.args[2], line.args[3], line.args[4]);
}
else
{
P_ExecuteSpecial(sa->Action, NULL, self, false, sa->Args[0], sa->Args[1], sa->Args[2], sa->Args[3], sa->Args[4]);
}
}
}

View file

@ -274,14 +274,10 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape)
#pragma message("Fixme: This needs to be evaluated at run time")
if (tag != 0 || special == 11 || special == 51 || special == 52 || special == 124)
{
// This cannot be evaluated here because this needs to be done in the context of the level being used.
FSpecialAction & bossact = mape->BossActions[mape->BossActions.Reserve(1)];
line_t line;
maplinedef_t mld;
mld.special = special;
mld.tag = tag;
//level.TranslateLineDef(&line, &mld);
bossact = { type, (uint8_t)line.special, {line.args[0], line.args[1],line.args[2],line.args[3],line.args[4]} };
}
bossact = { type, special | 0x40000000, tag };
};
}
}
else