- parameters for FRandomPick should not be added up.

(I hope that this code is correct, all I can judge it by is the assert not being triggered.)
This commit is contained in:
Christoph Oelckers 2015-04-29 01:03:50 +02:00
parent e42b688afa
commit 4c17bd65a4
2 changed files with 4 additions and 2 deletions

View File

@ -2189,6 +2189,7 @@ ExpEmit FxRandomPick::Emit(VMFunctionBuilder *build)
{ {
double val = static_cast<FxConstant *>(choices[i])->GetValue().GetFloat(); double val = static_cast<FxConstant *>(choices[i])->GetValue().GetFloat();
build->Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, build->GetConstantFloat(val)); build->Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, build->GetConstantFloat(val));
build->ParamChange(-1); // all params should use the same register here.
} }
} }
else else

View File

@ -51,6 +51,9 @@ public:
void FillAddressConstants(FVoidObj *konst, VM_ATAG *tags); void FillAddressConstants(FVoidObj *konst, VM_ATAG *tags);
void FillStringConstants(FString *strings); void FillStringConstants(FString *strings);
// PARAM increases ActiveParam; CALL decreases it.
void ParamChange(int delta);
// Track available registers. // Track available registers.
RegAvailability Registers[4]; RegAvailability Registers[4];
@ -76,8 +79,6 @@ private:
TArray<VMOP> Code; TArray<VMOP> Code;
// PARAM increases ActiveParam; CALL decreases it.
void ParamChange(int delta);
}; };
#endif #endif