Describe the bug
If an object is created at compiletime and it contains a null reference, the initCompiletimeState function will save the null reference as an integer.
Here is an example:
package Hello
import NoWurst
import public _Handles // map does not load without this import. error in generated lua script?
import public MagicFunctions
function print(string msg)
DisplayTimedTextToPlayer(GetLocalPlayer(), 0., 0., 45., msg)
class A
function foo()
print("I am A")
class B
A a = null
function createB() returns B
return new B()
constant b = compiletime(createB())
init
if b.a == null
b.a = new A()
b.a.foo()
The init part will not work, because b.a == null returns false (b.a = 0), so no new object is created and foo cannot be called on an integer.
Describe the bug If an object is created at compiletime and it contains a null reference, the initCompiletimeState function will save the null reference as an integer.
Here is an example:
The init part will not work, because b.a == null returns false (b.a = 0), so no new object is created and foo cannot be called on an integer.