diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index df9d2bb463..b6de3a6643 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -584,7 +584,7 @@ static ExpEmit EmitKonst(VMFunctionBuilder *build, ExpEmit &emit) ExpEmit FxVectorValue::Emit(VMFunctionBuilder *build) { - // no const handling here. Ultimstely it's too rarely used (i.e. the only fully constant vector ever allocated in ZDoom is the 0-vector in a very few places) + // no const handling here. Ultimately it's too rarely used (i.e. the only fully constant vector ever allocated in ZDoom is the 0-vector in a very few places) // and the negatives (excessive allocation of float constants) outweigh the positives (saved a few instructions) assert(xyz[0] != nullptr); assert(xyz[1] != nullptr); @@ -1770,10 +1770,11 @@ FxExpression *FxUnaryNotBitwise::Resolve(FCompileContext& ctx) { int result = ~static_cast(Operand)->GetValue().GetInt(); FxExpression *e = new FxConstant(result, ScriptPosition); + e->ValueType = Operand->ValueType == TypeUInt32 ? TypeUInt32 : TypeSInt32; delete this; return e; } - ValueType = TypeSInt32; + ValueType = Operand->ValueType == TypeUInt32? TypeUInt32 : TypeSInt32; return this; } diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index d19850554e..65e2e756c0 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -443,7 +443,7 @@ begin: ASSERTD(a); ASSERTF(B); reg.d[a] = reg.f[B] != 0; } - else if (c == CASTB_A) + else if (C == CASTB_A) { ASSERTD(a); ASSERTA(B); reg.d[a] = reg.a[B] != nullptr;