Page MenuHomeFeedback Tracker

[BUG] A3\functions_f\respawn\fn_getRespawnPositions.sqf breaks with group as input while its meant to be supported
New, NormalPublic

Description

TLDR:
p:\A3\functions_f\respawn\fn_getRespawnPositions.sqf
L53

_sidePositions = missionnamespace getvariable [_varName + str (_target call bis_fnc_objectSide),_default];

=>

_sidePositions = missionnamespace getvariable [_varName + str (side _target),_default];
Description:
Return scripted respawn positions available for the given unit
 
Parameter(s):
    0: OBJECT, GROUP, SIDE or NAMESPACE
    1 (Optional): BOOL - false to return positions, true to their names (default: false) 
                  NUMBER - 1 to return positions, 2 to return their names, 3 to return show info
_target = _this param [0,player,[objnull,grpnull,sideunknown,missionnamespace]];
...
switch (typename _target) do {
    case (typename objnull): {
        _objectPositions = if (isnull _target) then {_default} else {_target getvariable [_varName,_default]};
        _groupPositions = if (isnull group _target) then {_default} else {(group _target) getvariable [_varName,_default]};
        _sidePositions = missionnamespace getvariable [_varName + str (_target call bis_fnc_objectSide),_default];
    };
    case (typename grpnull): {
        _groupPositions = if (isnull _target) then {_default} else {(_target) getvariable [_varName,_default]};
        _sidePositions = missionnamespace getvariable [_varName + str (_target call bis_fnc_objectSide),_default];
    };

so currently if you supply a group, it tries to _target call bis_fnc_objectSide

however p:\A3\functions_f\sides\fn_objectSide.sqf

/*
    Author: Karel Moricky

    Description:
    Returns object side as defined in config (i.e., not affected by dynamic changing)

    Parameter(s):
    0: OBJECT
    1: BOOL - false (default) to return actual object side, true to return the default one (set in config)

    Returns:
    SIDE
*/

private ["_object","_static"];
_object = _this param [0,objnull,[objnull]];
_static = _this param [1,false,[false]];

if (_static) then {
    (getnumber (configfile >> "cfgvehicles" >> typeof _object >> "side")) call bis_fnc_sideType
} else {
    if (_object call bis_fnc_isUnitVirtual) then {
        _object getvariable ["bis_fnc_objectside_side",side _object]
    } else {
        if (isnull group _object) then {side _object} else {side group _object}
    };
};

breaks with

Error in expression < ["_object","_static"];
_object = _this param [0,objnull,[objnull]];
_static = _>
  Error position: <param [0,objnull,[objnull]];
_static = _>
  Error Type Group, expected Object
File A3\functions_f\sides\fn_objectSide.sqf..., line 16
 ➥ Context:     ...
    [] L45 (A3\functions_f\respawn\fn_getRespawnPositions.sqf)
    [] L53 (A3\functions_f\respawn\fn_getRespawnPositions.sqf)
    [] L19 (A3\functions_f\sides\fn_objectSide.sqf)

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce
[group player, position player] call BIS_fnc_addRespawnPosition;
TEST_respawnPositions = group player call bis_fnc_getRespawnPositions;
Additional Information

Event Timeline

This comment was removed by BIS_fnc_KK.