Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setShotParents in Advanced Throwing #5052

Merged
merged 2 commits into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/advanced_throwing/functions/fnc_exitThrowMode.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ if !(_unit getVariable [QGVAR(primed), false]) then {
_unit setVariable [QGVAR(lastThrownTime), CBA_missionTime];
// Fix floating for throwables without proper physics (eg. IR Grenade)
_activeThrowable setVelocity [0, 0, -0.1];

// Set thrower
[QEGVAR(common,setShotParents), [_activeThrowable, _unit, (getShotParents _activeThrowable) select 1]] call CBA_fnc_serverEvent;
};

// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
Expand Down
3 changes: 3 additions & 0 deletions addons/advanced_throwing/functions/fnc_prime.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ deleteVehicle _activeThrowableOld;
_activeThrowable // projectile
]] call CBA_fnc_globalEvent;

// Set prime instigator
[QEGVAR(common,setShotParents), [_activeThrowable, _unit, _unit]] call CBA_fnc_serverEvent;

if (_showHint) then {
// Show primed hint
private _displayNameShort = getText (configFile >> "CfgMagazines" >> _throwableMag >> "displayNameShort");
Expand Down
1 change: 1 addition & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ if (isServer) then {
if (isServer) then {
[QGVAR(hideObjectGlobal), {(_this select 0) hideObjectGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(enableSimulationGlobal), {(_this select 0) enableSimulationGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setShotParents), {(_this select 0) setShotParents [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler;
["ace_setOwner", {(_this select 0) setOwner (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(serverLog), FUNC(serverLog)] call CBA_fnc_addEventHandler;
};
Expand Down