Merge pull request #2094 from jokoho48/codeCleanupFingering

Code cleanup of Finger module.
This commit is contained in:
PabstMirror 2015-08-13 15:09:18 -05:00
commit 8f142e26f8
4 changed files with 8 additions and 8 deletions

View File

@ -16,10 +16,10 @@
*/
#include "script_component.hpp"
PARAMS_2(_sourceUnit,_fingerPosPrecise);
private ["_data", "_fingerPos"];
params ["_sourceUnit", "_fingerPosPrecise"];
//add some random float to location if it's not our own finger:
_fingerPos = if (_sourceUnit == ACE_player) then {
_fingerPosPrecise

View File

@ -38,7 +38,7 @@ _sendFingerToPlayers = [];
_nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]);
{
_nearbyMen append (crew _x);
} forEach (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]);
} count (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]);
{
if ((((eyePos _x) vectorDistance _playerEyePos) < GVAR(maxRange)) &&
@ -50,7 +50,8 @@ _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]);
_sendFingerToPlayers pushBack _x;
};
} forEach _nearbyMen;
true
} count _nearbyMen;
TRACE_1("sending finger to",_sendFingerToPlayers);

View File

@ -13,8 +13,7 @@
#include "script_component.hpp"
PARAMS_1(_logic);
params ["_logic"];
if !(isServer) exitWith {};
[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule);

View File

@ -30,7 +30,7 @@ _iconSize = BASE_SIZE * _fovCorrection;
{
_data = HASH_GET(GVAR(fingersHash), _x);
EXPLODE_3_PVT(_data,_lastTime,_pos,_name);
_data params ["_lastTime", "_pos", "_name"];
_timeLeftToShow = _lastTime + FP_TIMEOUT - ACE_diagTime;
if (_timeLeftToShow <= 0) then {
HASH_REM(GVAR(fingersHash), _x);
@ -43,7 +43,7 @@ _iconSize = BASE_SIZE * _fovCorrection;
drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"];
};
} forEach (GVAR(fingersHash) select 0);
} count (GVAR(fingersHash) select 0);
if ((count (GVAR(fingersHash) select 0)) == 0) then {
[GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler;