Fix FVector incompatible operands errors

This commit is contained in:
RaveYard 2022-06-14 09:07:10 +02:00 committed by Christoph Oelckers
parent 2d10ad9d2d
commit 4c588077c2

View file

@ -2777,7 +2777,7 @@ FxExpression *FxAddSub::Resolve(FCompileContext& ctx)
else if (left->IsVector() && right->IsVector())
{
// a vector2 can be added to or subtracted from a vector 3 but it needs to be the right operand.
if (left->ValueType == right->ValueType || (left->IsVector3() && right->IsVector2()))
if (((left->IsVector3() || left->IsVector2()) && right->IsVector2()) || (left->IsVector3() && right->IsVector3()))
{
ValueType = left->ValueType;
}