mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- undid incorrect part of CheckClass fix.
This commit is contained in:
parent
bcfb437302
commit
5261acce1d
1 changed files with 18 additions and 7 deletions
|
@ -52,6 +52,7 @@
|
|||
#include "thingdef_exp.h"
|
||||
#include "m_fixed.h"
|
||||
#include "vmbuilder.h"
|
||||
#include "v_text.h"
|
||||
|
||||
ExpEmit::ExpEmit(VMFunctionBuilder *build, int type)
|
||||
: RegNum(build->Registers[type].Get(1)), RegType(type), Konst(false), Fixed(false)
|
||||
|
@ -3546,15 +3547,25 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
|
|||
|
||||
if (clsname != NAME_None)
|
||||
{
|
||||
// for backwards compatibility with old times it cannot be made a fatal error, if the class is not defined. :(
|
||||
cls = desttype->FindClassTentative(clsname, false);
|
||||
if (!cls->IsDescendantOf(desttype))
|
||||
cls = PClass::FindClass(clsname);
|
||||
if (cls == NULL)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR,"class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
delete this;
|
||||
return NULL;
|
||||
/* lax */
|
||||
// Since this happens in released WADs it must pass without a terminal error... :(
|
||||
ScriptPosition.Message(MSG_WARNING,
|
||||
"Unknown class name '%s'",
|
||||
clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
}
|
||||
ScriptPosition.Message(MSG_DEBUG,"resolving '%s' as class name", clsname.GetChars());
|
||||
else
|
||||
{
|
||||
if (!cls->IsDescendantOf(desttype))
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
delete this;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
ScriptPosition.Message(MSG_DEBUG, "resolving '%s' as class name", clsname.GetChars());
|
||||
}
|
||||
FxExpression *x = new FxConstant(cls, ScriptPosition);
|
||||
delete this;
|
||||
|
|
Loading…
Reference in a new issue