allow nullptr with spriteid/textureid/translationid (for default parameters/etc)

This commit is contained in:
Ricardo Luís Vaz Silva 2024-12-20 23:32:07 -03:00 committed by Rachael Alexanderson
parent d36fa3c36b
commit bdddfcc80a

View file

@ -1842,6 +1842,12 @@ FxExpression *FxTypeCast::Resolve(FCompileContext &ctx)
{
goto basereturn;
}
else if (ctx.Version >= MakeVersion(4, 15, 0) && basex->ValueType == TypeNullPtr && (ValueType == TypeSpriteID || ValueType == TypeTextureID || ValueType == TypeTranslationID))
{
delete basex;
basex = new FxConstant(0, ScriptPosition);
goto basereturn;
}
else if (IsFloat())
{
FxExpression *x = new FxFloatCast(basex);