Page MenuHomeFeedback Tracker

BIS_fnc_getRespawnInventories does not protect all local variables
New, NormalPublic

Description

BIS_fnc_getRespawnInventories does not declare local variables (such as _group, _inventoryLimits, _roleLimits, _namespaces, and _i) as private, thus causing variable name collision with functions calling into it.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10
Category
Scripting
Steps To Reproduce

private _i = 1;
diag_log format ["_i is: %1", _i]; _i is 1
[player] call BIS_fnc_getRespawnInventories;
diag_log format ["_i is: %1", _i];
_i is now 0 (or whatever it was left as in BIS_fnc_getRespawnInventories)

Event Timeline

mteijiro created this task.Aug 20 2020, 2:41 AM

This also seems to be the case with a significant number of other functions in this library including BIS_fnc_addRespawnInventory, BIS_fnc_addRespawnPosition, and BIS_fnc_getRespawnPositions.

mteijiro updated the task description. (Show Details)Aug 20 2020, 7:18 PM