Skip to content

Commit e77f918

Browse files
committed
utilize new deleted EH for projectiles
1 parent c5e6ac2 commit e77f918

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

x/ocap/addons/recorder/fnc_eh_firedMan.sqf

+14-8
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ switch (true) do {
100100
};
101101
if (isNil "_projectile") exitWith {};
102102

103+
104+
LOGBULLET;
105+
103106
_projectile addEventHandler ["Deleted", {
104107
params ["_projectile"];
105108
[":FIRED:", [
@@ -108,7 +111,6 @@ switch (true) do {
108111
_pos
109112
]] call EFUNC(extension, sendData);
110113
};
111-
// LOGBULLET;
112114
};
113115

114116

@@ -140,7 +142,7 @@ switch (true) do {
140142
};
141143
};
142144
case (_ammoSimType in ["shotGrenade", "shotIlluminating", "shotMine", "shotSmokeX", "shotCM"]): {
143-
// LOGGRENADE;
145+
LOGGRENADE;
144146

145147
_projectile setVariable [GVAR(ocapdata), [_projectile, _wepString, _firer, getPosASL _projectile, _markName, _markTextLocal, _ammoSimType]];
146148

@@ -163,18 +165,22 @@ switch (true) do {
163165
case (_ammoSimType isEqualTo "shotSubmunitions"): {
164166

165167

166-
_projectile setVariable [GVAR(data), ([_weapon, _muzzle, _ammo, _magazine, _projectile, _vehicle, _ammoSimType] call FUNC(getAmmoMarkerData))];
168+
_projectile setVariable [GVAR(markerData), ([_weapon, _muzzle, _ammo, _magazine, _projectile, _vehicle, _ammoSimType] call FUNC(getAmmoMarkerData))];
169+
_projectile setVariable [GVAR(EHData), [_this, _subTypes, _magazine, _wepString, _firer, _firerId, _firerPos, _frame, _ammoSimType, _subTypesAmmoSimType]];
170+
167171

168172

169173
_projectile addEventHandler ["SubmunitionCreated", {
170174
params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"];
171-
(_projectile getVariable [GVAR(data), []]) params ["_markTextLocal", "_markName", "_markColor", "_markerType"];
175+
(_projectile getVariable [GVAR(markerData), []]) params ["_markTextLocal", "_markName", "_markColor", "_markerType"];
176+
(_projectile getVariable [GVAR(EHData), []]) params ["_EHData", "_subTypes", "_magazine", "_wepString", "_firer", "_firerId", "_firerPos", "_frame", "_ammoSimType", "_subTypesAmmoSimType"];
177+
172178
_submunitionProjectile setVariable [QGVAR(firerId), _projectile getVariable [QGVAR(firerId), -1]];
173179

174180
private _magIcon = getText(configFile >> "CfgMagazines" >> _magazine >> "picture");
175181

176182
// then get data of submunition to determine how to track it
177-
private _ammoSimType = getText(configFile >> "CfgAmmo" >> (typeOf _projectile) >> "simulation");
183+
private _ammoSimType = getText(configFile >> "CfgAmmo" >> (typeOf _submunitionProjectile) >> "simulation");
178184

179185

180186
switch (true) do {
@@ -197,7 +203,7 @@ switch (true) do {
197203

198204
if (GVARMAIN(isDebug)) then {
199205
// add to clients' map draw array
200-
private _debugArr = [_projectile, _magIcon, format["%1 %2 - %3", str side group _firer, name _firer, _markTextLocal], [side group _firer] call BIS_fnc_sideColor];
206+
private _debugArr = [_submunitionProjectile, _magIcon, format["%1 %2 - %3", str side group _firer, name _firer, _markTextLocal], [side group _firer] call BIS_fnc_sideColor];
201207
[QGVAR(addDebugMagIcon), _debugArr] call CBA_fnc_globalEvent;
202208
};
203209
};
@@ -209,12 +215,12 @@ switch (true) do {
209215

210216
if (GVARMAIN(isDebug)) then {
211217
// add to map draw array
212-
private _debugArr = [_projectile, _magIcon, format["%1 %2 - %3", str side group _firer, name _firer, _markTextLocal], [side group _firer] call BIS_fnc_sideColor];
218+
private _debugArr = [_submunitionProjectile, _magIcon, format["%1 %2 - %3", str side group _firer, name _firer, _markTextLocal], [side group _firer] call BIS_fnc_sideColor];
213219
[QGVAR(addDebugMagIcon), _debugArr] call CBA_fnc_globalEvent;
214220
};
215221
};
216222
default {
217-
OCAPEXTLOG(ARR3("Invalid ammo sim type, check it", _projectile, _ammoSimType))
223+
OCAPEXTLOG(ARR3("Invalid ammo sim type, check it", _submunitionProjectile, _ammoSimType))
218224
};
219225
};
220226
}];

x/ocap/addons/recorder/fnc_projectileMonitors.sqf

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ GVAR(liveMissiles) = [];
5252
OCAPEXTLOG(ARR4("FIRED EVENT: SHELL-ROCKET-MISSILE", GVAR(captureFrameNo), _firer getVariable QGVARMAIN(id), str _pos));
5353
};
5454

55-
[{[QGVARMAIN(handleMarker), ["DELETED", _this]] call CBA_fnc_localEvent}, _markName, 10] call CBA_fnc_waitAndExecute;
55+
// [{[QGVARMAIN(handleMarker), ["DELETED", _this]] call CBA_fnc_localEvent}, _markName, 10] call CBA_fnc_waitAndExecute;
5656
} forEach _processNow;
5757

5858
// for missiles that still exist, update positions
@@ -86,7 +86,7 @@ GVAR(liveGrenades) = [];
8686
OCAPEXTLOG(ARR4("FIRED EVENT: GRENADE-FLARE-SMOKE", GVAR(captureFrameNo), _firer getVariable QGVARMAIN(id), str _pos));
8787
};
8888

89-
[{[QGVARMAIN(handleMarker), ["DELETED", _this]] call CBA_fnc_localEvent}, _markName, 10] call CBA_fnc_waitAndExecute;
89+
// [{[QGVARMAIN(handleMarker), ["DELETED", _this]] call CBA_fnc_localEvent}, _markName, 10] call CBA_fnc_waitAndExecute;
9090
} forEach _processNow;
9191

9292
// for grenades that still exist, update positions

0 commit comments

Comments
 (0)