Page MenuHomeFeedback Tracker

BIS_fnc_endMission has to be called twice because of double brackets
Closed, ResolvedPublic

Description

If you call BIS_fnc_endMission using:

"end1"call BIS_fnc_endMission;

nothing will happen. You have to call the function twice:

"end1"call(call BIS_fnc_endMission);

If you look at the function code, you will notice double brackets:

"{{_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then _fnc_scriptName} else {'BIS_fnc_endMission'};"

Details

Legacy ID
186225388
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Go into the editor, place a unit and press "PLAY"
  1. Execute the following SQF-Code: "end1"call BIS_fnc_endMission;
  1. Execute the following SQF-Code: hint str BIS_fnc_endMission; And you will see the double brackets

Event Timeline

Bohemia edited Steps To Reproduce. (Show Details)Jan 4 2016, 8:04 PM
Bohemia set Category to Scripting.
Bohemia set Reproducibility to Always.
Bohemia set Severity to None.
Bohemia set Resolution to No Bug.
Bohemia set Legacy ID to 186225388.May 8 2016, 1:26 PM

Interesting, I use for instance ["end1", true, 0.001] call BIS_fnc_endMission, which works, but it doesn't show the achieved objectives in the final overview. I wonder if it's related to this issue.

Could you test this on current DEV please? I cannot reproduce this.

Bohemia added a subscriber: Bohemia.May 8 2016, 1:26 PM

I am sorry, I created a new editor mission and the double brackets where gone. There are double brackets only in my custom editor mission, i don't know why, but if I play my own mission, there are double brackets

//Edit: My editor mission is an altis life mission, i think this could be the reason for the double brackets:

/*
File: initPlayerLocal.sqf

Description:
Starts the initialization of the player.
*/
if(!hasInterface)exitWith{};
#define CONST(var1,var2) var1 = compileFinal (if(typeName var2 == "STRING") then {var2} else {str(var2)})
CONST(BIS_fnc_endMission,BIS_fnc_endMission);

  • execVM "core\init.sqf";if((_this select 1))then{[]execVM "core\jip.sqf"};

Yep looks like this is what causing double brackets. So I'm going to resolve this then.