mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleanup
This commit is contained in:
parent
e235ebcc15
commit
9c0478ddfd
@ -6,7 +6,7 @@ if(GVAR(EnableDebugTrace) && !isMultiplayer) then {
|
||||
};
|
||||
|
||||
if(isServer) then {
|
||||
[QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler;
|
||||
[QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
||||
[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler;
|
@ -28,14 +28,16 @@ if(_gun == ACE_player) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_doSpall = false;
|
||||
if(GVAR(SpallEnabled)) then {
|
||||
if(GVAR(spallIsTrackingCount) <= 0) then {
|
||||
GVAR(spallHPData) = [];
|
||||
};
|
||||
if(GVAR(spallIsTrackingCount) > 5) then {
|
||||
// ACE_player sideChat "LIMT!";
|
||||
_doSpall = false;
|
||||
} else {
|
||||
_doSpall = true;
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
|
||||
};
|
||||
};
|
||||
@ -70,6 +72,3 @@ if(_doFragTrack && alive _round) then {
|
||||
};
|
||||
// ACE_player sideChat "WTF2";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -1,11 +1,7 @@
|
||||
//fnc_findReflections.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange",
|
||||
"_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos",
|
||||
"_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp",
|
||||
"_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec"];
|
||||
|
||||
private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"];
|
||||
|
||||
_params = _this select 0;
|
||||
_pos = _params select 0;
|
||||
|
@ -15,13 +15,13 @@
|
||||
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
private["_gcIndex"];
|
||||
private["_gcIndex", "_iter"];
|
||||
_gcIndex = [];
|
||||
|
||||
_iter = 0;
|
||||
while { (count GVAR(objects)) > 0 && { _iter < GVAR(MaxTrackPerFrame) } } do {
|
||||
while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do {
|
||||
private["_object", "_args"];
|
||||
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) exitWith {
|
||||
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then {
|
||||
GVAR(lastIterationIndex) = 0;
|
||||
};
|
||||
_object = GVAR(objects) select GVAR(lastIterationIndex);
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD
|
||||
|
||||
PARAMS_1(_round);
|
||||
|
||||
if(_round in GVAR(blackList)) then {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
|
@ -1,52 +0,0 @@
|
||||
//fnc_trackFragRound.sqf
|
||||
#include "script_component.hpp"
|
||||
private ["_params", "_round", "_lastPos", "_lastVel", "_type", "_time", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
|
||||
_params = _this select 0;
|
||||
_round = _params select 0;
|
||||
_lastPos = _params select 1;
|
||||
_lastVel = _params select 2;
|
||||
_type = _params select 3;
|
||||
_time = _params select 4;
|
||||
_doSpall = _params select 6;
|
||||
_spallTrack = _params select 7;
|
||||
_foundObjectHPIds = _params select 8;
|
||||
|
||||
if (!alive _round) then {
|
||||
[_this select 1] call cba_fnc_removePerFrameHandler;
|
||||
if(_time != ACE_time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then {
|
||||
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
|
||||
_skip = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip));
|
||||
if(_skip == 0) then {
|
||||
_explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive");
|
||||
_indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange");
|
||||
_force = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force));
|
||||
_fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange));
|
||||
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
|
||||
[QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent;
|
||||
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
|
||||
};
|
||||
};
|
||||
};
|
||||
if(_doSpall) then {
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1;
|
||||
// diag_log text format["F: %1", _foundObjectHPIds];
|
||||
{
|
||||
if(!isNil "_x") then {
|
||||
_x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex];
|
||||
};
|
||||
} forEach _spallTrack;
|
||||
};
|
||||
} else {
|
||||
if(!(_round in GVAR(trackedObjects)) || {_round in GVAR(blackList)}) then {
|
||||
[_this select 1] call cba_fnc_removePerFrameHandler;
|
||||
if(_round in GVAR(blackList)) then {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
};
|
||||
|
||||
_params set[1, (getPosASL _round)];
|
||||
_params set[2, (velocity _round)];
|
||||
if(_doSpall) then {
|
||||
[_round, 1, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user