mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Allow string function names.
This commit is contained in:
parent
40c5de8cfb
commit
4a23b8be00
@ -5,7 +5,7 @@
|
||||
* Arguments:
|
||||
* 0: Emitter <object>
|
||||
* 1: Owner <object>
|
||||
* 2: Method, can be code, which emitter and owner are passed to, an array with a position memory point and weapon name, or an array with a position memory point, a vector begining memory point, and vector ending memory point.
|
||||
* 2: Method, can be code, which emitter and owner are passed to, a string function name, an array with a position memory point and weapon name, or an array with a position memory point, a vector begining memory point, and vector ending memory point.
|
||||
* 3: Wavelength (1550nm is common eye safe) <number>
|
||||
* 4: Laser code <number>
|
||||
* 5: Beam divergence (in mils off beam center).
|
||||
|
@ -39,15 +39,19 @@ _finalOwner = nil;
|
||||
_laser = [];
|
||||
if(IS_CODE(_method)) then {
|
||||
_laser = _x call _method;
|
||||
} else {
|
||||
if(IS_ARRAY(_method)) then {
|
||||
if(count _method == 2) then {
|
||||
_laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), _obj weaponDirection (_method select 1)];
|
||||
} else {
|
||||
if(count _method == 3) then {
|
||||
_laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), (ATLtoASL (_obj modelToWorldVisual (_method select 1))) vectorFromTo (ATLtoASL (_obj modelToWorldVisual (_method select 2)))];
|
||||
} else {
|
||||
if(IS_STRING(_method)) then {
|
||||
_laser = _x call (missionNamespace getVariable [_method, {}]);
|
||||
} else {
|
||||
if(IS_ARRAY(_method)) then {
|
||||
if(count _method == 2) then {
|
||||
_laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), _obj weaponDirection (_method select 1)];
|
||||
} else {
|
||||
if(count _method == 3) then {
|
||||
_laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), (ATLtoASL (_obj modelToWorldVisual (_method select 1))) vectorFromTo (ATLtoASL (_obj modelToWorldVisual (_method select 2)))];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
_laserPos = _laser select 0;
|
||||
|
Loading…
Reference in New Issue
Block a user