mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #2085 from jokoho48/codeCleanupDisposable
Code cleanup of Disposable module
This commit is contained in:
commit
6755b8766a
@ -5,6 +5,7 @@ if (!hasInterface) exitWith {};
|
||||
|
||||
["inventoryDisplayLoaded", {[ACE_player, _this select 0] call FUNC(updateInventoryDisplay)}] call EFUNC(common,addEventHandler);
|
||||
["playerInventoryChanged", {
|
||||
[_this select 0, _this select 1 select 11] call FUNC(takeLoadedATWeapon);
|
||||
[_this select 0] call FUNC(updateInventoryDisplay);
|
||||
params ["_unit", "_items"];
|
||||
[_unit, _items select 11] call FUNC(takeLoadedATWeapon);
|
||||
[_unit] call FUNC(updateInventoryDisplay);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -21,11 +21,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_projectile", "_replacementTube", "_items"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_projectile = _this select 6;
|
||||
private ["_replacementTube", "_items"];
|
||||
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
@ -43,19 +40,19 @@ _unit selectWeapon _replacementTube;
|
||||
//Re-add all attachments to the used tube
|
||||
{
|
||||
if (_x != "") then {_unit addSecondaryWeaponItem _x};
|
||||
} forEach _items;
|
||||
} count _items;
|
||||
|
||||
|
||||
// AI - Remove the ai's missle launcher tube after the missle has exploded
|
||||
if !([_unit] call EFUNC(common,isPlayer)) then {
|
||||
[{
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_3_PVT(_params,_unit,_tube,_projectile);
|
||||
params ["args","_idPFH"];
|
||||
_args params ["_unit", "_tube", "_projectile"];
|
||||
|
||||
//don't do anything until projectile is null (exploded/max range)
|
||||
if (isNull _projectile) then {
|
||||
//Remove PFEH:
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
[_idPFH] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
//If (tube is dropped) OR (is dead) OR (is player) just exit
|
||||
if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {};
|
||||
|
@ -17,7 +17,8 @@
|
||||
|
||||
private ["_unit", "_launcher", "_config"];
|
||||
|
||||
PARAMS_1(_unit);
|
||||
params ["_unit"];
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
_launcher = secondaryWeapon _unit;
|
||||
|
@ -16,9 +16,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
|
||||
PARAMS_1(_player);
|
||||
DEFAULT_PARAM(1,_display,(findDisplay 602));
|
||||
params ["_player", ["_display",(findDisplay 602),[(findDisplay 602)]]]
|
||||
|
||||
_player removeMagazines "ACE_PreloadedMissileDummy";
|
||||
_player removeMagazines "ACE_FiredMissileDummy";
|
||||
|
Loading…
Reference in New Issue
Block a user