- fixed FxFRandom setup which used a path in FxRandom that is no longer supported.

This commit is contained in:
Christoph Oelckers 2018-11-17 08:06:23 +01:00
parent f99bba48dc
commit e643582957
2 changed files with 15 additions and 6 deletions

View file

@ -5441,14 +5441,23 @@ ExpEmit FxMinMax::Emit(VMFunctionBuilder *build)
//
//
//==========================================================================
FxRandom::FxRandom(FRandom * r, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos, bool nowarn)
FxRandom::FxRandom(EFxType type, FRandom * r, const FScriptPosition &pos)
: FxExpression(EFX_Random, pos)
{
EmitTail = false;
rng = r;
}
//==========================================================================
//
//
//
//==========================================================================
FxRandom::FxRandom(FRandom * r, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos, bool nowarn)
: FxRandom(EFX_Random, rng, pos)
{
assert(mi && ma);
min = new FxIntCast(mi, nowarn);
max = new FxIntCast(ma, nowarn);
rng = r;
ValueType = TypeSInt32;
}
@ -5721,13 +5730,12 @@ ExpEmit FxRandomPick::Emit(VMFunctionBuilder *build)
//
//==========================================================================
FxFRandom::FxFRandom(FRandom *r, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos)
: FxRandom(r, nullptr, nullptr, pos, true)
: FxRandom(EFX_FRandom, r, pos)
{
assert(mi && ma);
min = new FxFloatCast(mi);
max = new FxFloatCast(ma);
ValueType = TypeFloat64;
ExprType = EFX_FRandom;
}
//==========================================================================

View file

@ -1257,10 +1257,11 @@ public:
class FxRandom : public FxExpression
{
protected:
bool EmitTail;
bool EmitTail = false;
FRandom *rng;
FxExpression *min, *max;
FxRandom(EFxType type, FRandom * r, const FScriptPosition &pos);
public:
FxRandom(FRandom *, FxExpression *mi, FxExpression *ma, const FScriptPosition &pos, bool nowarn);