- fixed: The morph actors stored their required classes as names, not as class pointers.
This prevented any kind of error check on them. Unfortunately, due to backwards compatibility needs, on DECORATE the missing class may not be fatal so a workaround had to be added to clear those bogus pointers later if they are discovered to be broken. For ZScript, though, this will result in a compile error, which was the intention behind this change.
This commit is contained in:
parent
5e67cf79d3
commit
7527141ad4
7 changed files with 64 additions and 40 deletions
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
void InitThingdef();
|
||||
TArray<PClassActor **> OptionalClassPtrs;
|
||||
|
||||
// STATIC FUNCTION PROTOTYPES --------------------------------------------
|
||||
PClassActor *QuestItemClasses[31];
|
||||
|
|
@ -390,8 +391,21 @@ void LoadActors ()
|
|||
{
|
||||
if (ti->Size == TentativeClass)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Class %s referenced but not defined\n", ti->TypeName.GetChars());
|
||||
FScriptPosition::ErrorCounter++;
|
||||
if (ti->ObjectFlags & OF_Transient)
|
||||
{
|
||||
Printf(TEXTCOLOR_ORANGE "Class %s referenced but not defined\n", ti->TypeName.GetChars());
|
||||
FScriptPosition::WarnCounter++;
|
||||
DObject::StaticPointerSubstitution(ti, nullptr);
|
||||
for (auto op : OptionalClassPtrs)
|
||||
{
|
||||
if (*op == ti) *op = nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Class %s referenced but not defined\n", ti->TypeName.GetChars());
|
||||
FScriptPosition::ErrorCounter++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -431,4 +445,6 @@ void LoadActors ()
|
|||
QuestItemClasses[i] = PClass::FindActor(fmt);
|
||||
}
|
||||
StateSourceLines.Clear();
|
||||
OptionalClassPtrs.Clear();
|
||||
OptionalClassPtrs.ShrinkToFit();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue