Page MenuHomeFeedback Tracker

OBJECT setVariable NIL does not delete variables
Closed, ResolvedPublic

Description

Using a value of nil with setVariable on an object, the variable is not deleted from the object. For example:

allVariables player; // Returns: []
player setVariable ["something", true, true];
allVariables player; // Returns: ["something"]
player setVariable ["something", nil, true];
allVariables player; // Returns: ["something"]

This in my opinion is very unexpected behaviour and has potential for performance degradation in MP environments. Because the variables are not being deleted correctly, JIP clients are still being sent those variable names along with a value that when converted to a string returns "<null>".

However using missionNamespace instead of an object such as player will result in what I believe is, or at least should be the intended behaviour. In this case the variable is correctly deleted and the variable can no longer be returned using allVariables missionNamespace.

Details

Severity
None
Resolution
Won't Fix
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce
allVariables player; // Returns: []
player setVariable ["something", true, true];
allVariables player; // Returns: ["something"]
player setVariable ["something", nil, true];
allVariables player; // Returns: ["something"]

Event Timeline

Nimrod created this task.May 2 2020, 3:08 PM
dedmen claimed this task.May 2 2020, 3:08 PM

Hopefully fixing this will result in fewer server restarts needed to maintain/restore performance

this is used a lot in our mp mission and I imagine the impact of not deleting variables is large, in our case.

This comment was removed by dedmen.
This comment was removed by BIS_fnc_KK.
honger added a subscriber: honger.Jan 16 2023, 2:07 PM

This seems to be ntentional. I don't know why. Someone a long time ago notd "strange issues" when we delete them. So we'll leave it be.

BIS_fnc_KK closed this task as Resolved.Jan 22 2023, 10:12 AM
BIS_fnc_KK changed Severity from Major to None.
BIS_fnc_KK changed Resolution from Open to Won't Fix.