From 157cfe3ab37e7b94fe98a19fb53e45804e62a62f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Nov 2016 09:23:29 +0100 Subject: [PATCH] - fixed: The RNG was not initialized for script calls that did not explicitly specify an RNG by name. --- src/scripting/codegeneration/codegen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index 4c26da5954..9cbc1c2b16 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -55,6 +55,8 @@ #include "v_text.h" #include "math/cmath.h" +extern FRandom pr_exrandom; + struct FLOP { ENamedName Name; @@ -5733,7 +5735,7 @@ FxFunctionCall::FxFunctionCall(FName methodname, FName rngname, FArgumentList *a : FxExpression(EFX_FunctionCall, pos) { MethodName = methodname; - RNG = nullptr; + RNG = &pr_exrandom; ArgList = args; if (rngname != NAME_None) {