mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
more common code cleanup
This commit is contained in:
parent
e8ebe87450
commit
e62683a0c4
@ -3,18 +3,20 @@
|
||||
*
|
||||
* Execute a global event on all clients, including self.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name (string)
|
||||
* 1: Event args (any)
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event args <ANY>
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
//IGNORE_PRIVATE_WARNING("_handleNetEvent");
|
||||
|
||||
PARAMS_2(_eventName,_eventArgs);
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
publicVariable "ACEg";
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
|
@ -1,32 +1,22 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Move unit to kneeling position.
|
||||
*
|
||||
* Abhocken! Unit goes kneeling if not prone already and lowers weapon. Try, throw, catch because I'm bored.
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Argument:
|
||||
* 0: Unit (Object)
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
params ["_unit"];
|
||||
|
||||
//IGNORE_PRIVATE_WARNING("_exception");
|
||||
if (stance _unit == "PRONE") exitWith {};
|
||||
|
||||
try {
|
||||
if (_unit == vehicle _unit) then {
|
||||
switch (currentWeapon _unit) do {
|
||||
case "" : {throw "AmovPknlMstpSnonWnonDnon"};
|
||||
case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"};
|
||||
case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"};
|
||||
case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"};
|
||||
case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"};
|
||||
};
|
||||
};
|
||||
} catch {
|
||||
if (stance _unit != "PRONE") then {
|
||||
[_unit, _exception] call FUNC(doAnimation);
|
||||
};
|
||||
};
|
||||
[
|
||||
_unit,
|
||||
["AmovPknlMstpSnonWnonDnon", "AmovPknlMstpSlowWrflDnon", "AmovPknlMstpSrasWlnrDnon", "AmovPknlMstpSlowWpstDnon", "AmovPknlMstpSoptWbinDnon"] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0)
|
||||
] call FUNC(doAnimation);
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -14,4 +14,4 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
!isNull (_this select 0) && {alive (_this select 0)}
|
||||
!isNull (_this select 0) && {alive (_this select 0)} // return
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
*
|
||||
* Check if unit is awake. Will be false when death or unit is unconscious.
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,4 +14,4 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]);
|
||||
!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]) // return
|
||||
|
@ -12,4 +12,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
isClass (configFile >> "cfgPatches" >> _this select 0) // return
|
||||
params ["_modName"];
|
||||
|
||||
isClass (configFile >> "cfgPatches" >> _modName) // return
|
||||
|
@ -24,4 +24,5 @@ _array = + _array;
|
||||
{
|
||||
_array set [_forEachIndex, _x call _code];
|
||||
} forEach _array;
|
||||
|
||||
_array
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, joko // Jonas
|
||||
*
|
||||
* Nothing to see here, move along.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: bux578, commy2
|
||||
*
|
||||
* Returns the player or curator controlled unit.
|
||||
* Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet.
|
||||
*
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Return the current side of the player
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: esteldunedain
|
||||
*
|
||||
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
|
||||
* Must be called on the server, effect is global.
|
||||
*
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Remove a condition that gets checked by ace_common_fnc_canInteractWith.
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP).
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Source string <STRING>
|
||||
* 1: Remove html tags (optional) <BOOL>
|
||||
* 1: Remove html tags (default: false) <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Sanitized string
|
||||
@ -15,28 +15,37 @@
|
||||
|
||||
params ["_string", ["_removeTags", false]];
|
||||
|
||||
private ["_array", "_arrayNew"];
|
||||
private "_array";
|
||||
_array = [];
|
||||
|
||||
_array = toArray _string;
|
||||
|
||||
_arrayNew = [];
|
||||
{
|
||||
switch _x do {
|
||||
case 60 : {
|
||||
_arrayNew = if (_removeTags) then {_arrayNew + toArray "<";} else {_arrayNew + [_x];};
|
||||
if (_removeTags) then {
|
||||
_array append toArray "<";
|
||||
} else {
|
||||
_array pushBack _x;
|
||||
};
|
||||
};
|
||||
case 62 : {
|
||||
_arrayNew = if (_removeTags) then {_arrayNew + toArray ">";} else {_arrayNew + [_x];};
|
||||
if (_removeTags) then {
|
||||
_array append toArray ">";
|
||||
} else {
|
||||
_array pushBack _x;
|
||||
};
|
||||
};
|
||||
|
||||
case 34 : {
|
||||
};
|
||||
|
||||
case 39 : {
|
||||
};
|
||||
|
||||
default {
|
||||
_arrayNew = _arrayNew + [_x];
|
||||
_array pushBack _x;
|
||||
};
|
||||
};
|
||||
false
|
||||
} count _array;
|
||||
} count toArray _string;
|
||||
|
||||
toString _arrayNew
|
||||
toString _array // return
|
||||
|
Loading…
Reference in New Issue
Block a user