Page MenuHomeFeedback Tracker

EnScript::GetClassVar function return is always false
Assigned, UrgentPublic

Description

EnScript::GetClassVar always returns false even if the variable is found and has data. A work around is to check the out result to see if it's not null or is the default value, but this makes it difficult if you're expecting or wanting to handle default values. Refer to "Steps To Reproduce" for example.

Details

Severity
Trivial
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce

Example

array<Man> players = {};
GetGame().GetPlayers(players);

float time;
bool success = EnScript.GetClassVar(players[0], "m_LastUpdatedTime", 0, time);

Print(count);
Print(success);

Output

SCRIPT       : float time = 567.948
SCRIPT       : bool success = 0

Event Timeline

Geez changed the task status from New to Assigned.Feb 6 2023, 12:13 PM

may be fixed soon? (this is so true at moment)
This seems not too hard to fix. GetVariableValue can do this right, but has no access to static array vars, but GetClassVar has)

plsplsplspls