PDA

View Full Version : Double Brackets



guiismiti
10th October 2015, 18:56
Hello again :)

Quick question - what are the double brackets for?



if(menu == game["menu_weapon_allies"] || menu == game["menu_weapon_axis"])
{
self closeMenu();
self closeInGameMenu();
self [[level.weapon]](response);
}



Thanks in advance.



Editted:
I just found this in the gametype script:
in main()


level.weapon = ::menuWeapon;


And the function:


menuWeapon(response)


I guess I answered my own question... is it some kind of alias for the function?

IzNoGoD
10th October 2015, 19:47
Yes, you are correct.



foo()
{
bar = ::foobar;
[[bar]]();
}

foobar()
{
iprintln("hello");
}