mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2050 from MikeMatrix/codeCleanupSpottingscope
Cleanup code of Spottingscope module
This commit is contained in:
@ -1,30 +1,30 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Rocko, Ruthberg
|
* Author: Rocko, Ruthberg
|
||||||
*
|
|
||||||
* Pick up spotting scope
|
* Pick up spotting scope
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: spotting scope <OBJECT>
|
* 0: spotting scope <OBJECT>
|
||||||
* 1: unit <OBJECT>
|
* 1: unit <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
|
||||||
* Nothing
|
|
||||||
*
|
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [spotting_scope, player] call ace_spottingscope_fnc_pickup
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_spottingScope,_unit);
|
params ["_spottingScope", "_unit"];
|
||||||
|
|
||||||
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
||||||
_unit playMove "AmovPercMstpSrasWrflDnon_diary";
|
_unit playMove "AmovPercMstpSrasWrflDnon_diary";
|
||||||
};
|
};
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_spottingScope,_unit);
|
params ["_spottingScope", "_unit"];
|
||||||
|
|
||||||
[_unit, "ACE_SpottingScope"] call EFUNC(common,addToInventory);
|
[_unit, "ACE_SpottingScope"] call EFUNC(common,addToInventory);
|
||||||
deleteVehicle _spottingScope;
|
deleteVehicle _spottingScope;
|
||||||
|
|
||||||
}, [_spottingScope, _unit], 1, 0]call EFUNC(common,waitAndExecute);
|
}, [_spottingScope, _unit], 1, 0]call EFUNC(common,waitAndExecute);
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Rocko, Ruthberg
|
* Author: Rocko, Ruthberg
|
||||||
*
|
|
||||||
* Place down spotting scope
|
* Place down spotting scope
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: unit <OBJECT>
|
* 0: unit <OBJECT>
|
||||||
* 1: scope class <STRING>
|
* 1: scope class <STRING>
|
||||||
*
|
*
|
||||||
* Return Value:
|
|
||||||
* Nothing
|
|
||||||
*
|
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player, "ACE_SpottingScope"] call ace_spottingscope_fnc_place
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_unit,_scopeClass);
|
params ["_unit", "_scopeClass"];
|
||||||
|
|
||||||
_unit removeItem _scopeClass;
|
_unit removeItem _scopeClass;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_1(_unit);
|
params ["_unit"];
|
||||||
|
|
||||||
private ["_direction", "_position", "_spottingScope"];
|
private ["_direction", "_position", "_spottingScope"];
|
||||||
_direction = getDir _unit;
|
_direction = getDir _unit;
|
||||||
@ -37,5 +38,4 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
|||||||
_spottingScope setVectorUp (surfaceNormal (position _spottingScope));
|
_spottingScope setVectorUp (surfaceNormal (position _spottingScope));
|
||||||
};
|
};
|
||||||
_unit reveal _spottingScope;
|
_unit reveal _spottingScope;
|
||||||
|
|
||||||
}, [_unit], 1, 0] call EFUNC(common,waitAndExecute);
|
}, [_unit], 1, 0] call EFUNC(common,waitAndExecute);
|
||||||
|
Reference in New Issue
Block a user