mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
Emit a message when trying to use something non-integral as a boolean
- It's not exactly optimal, since it silently removes the offending expression, but it's better than crashing.
This commit is contained in:
parent
09a17c2198
commit
48dcbabd60
1 changed files with 5 additions and 0 deletions
|
@ -143,11 +143,13 @@ FxExpression *FxExpression::Resolve(FCompileContext &ctx)
|
||||||
|
|
||||||
FxExpression *FxExpression::ResolveAsBoolean(FCompileContext &ctx)
|
FxExpression *FxExpression::ResolveAsBoolean(FCompileContext &ctx)
|
||||||
{
|
{
|
||||||
|
///FIXME: Use an actual boolean type
|
||||||
FxExpression *x = Resolve(ctx);
|
FxExpression *x = Resolve(ctx);
|
||||||
if (x != NULL)
|
if (x != NULL)
|
||||||
{
|
{
|
||||||
switch (x->ValueType.Type)
|
switch (x->ValueType.Type)
|
||||||
{
|
{
|
||||||
|
case VAL_Int:
|
||||||
case VAL_Sound:
|
case VAL_Sound:
|
||||||
case VAL_Color:
|
case VAL_Color:
|
||||||
case VAL_Name:
|
case VAL_Name:
|
||||||
|
@ -155,6 +157,9 @@ FxExpression *FxExpression::ResolveAsBoolean(FCompileContext &ctx)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
ScriptPosition.Message(MSG_ERROR, "Not an integral type");
|
||||||
|
delete this;
|
||||||
|
return NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue