Skip to content

Commit

Permalink
Merge pull request #3366 from acemod/cbacanuseweapon
Browse files Browse the repository at this point in the history
replace some ace_common_fnc_X with CBA_fnc_X
  • Loading branch information
commy2 committed Feb 22, 2016
2 parents 4aa3eee + 9712f9c commit dc16136
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 71 deletions.
2 changes: 0 additions & 2 deletions addons/common/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ PREP(blurScreen);
PREP(cachedCall);
PREP(canGetInPosition);
PREP(canInteractWith);
PREP(canUseWeapon);
PREP(changeProjectileDirection);
PREP(checkFiles);
PREP(checkPBOs);
Expand Down Expand Up @@ -139,7 +138,6 @@ PREP(resetAllDefaults);
PREP(restoreVariablesJIP);
PREP(runAfterSettingsInit);
PREP(sanitizeString);
PREP(selectWeaponMode);
PREP(sendRequest);
PREP(serverLog);
PREP(setAllGear);
Expand Down
11 changes: 11 additions & 0 deletions addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ ADDON = false;
GVAR(eventsLocation) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
GVAR(eventsLocation) setText QGVAR(eventsLocation);

// backwards comp
DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
_this call CBA_fnc_canUseWeapon;
};

DFUNC(selectWeaponMode) = {
ACE_DEPRECATED("ace_common_fnc_selectWeaponMode","3.7.0","CBA_fnc_selectWeapon");
_this call CBA_fnc_selectWeapon;
};

GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate);

Expand Down
23 changes: 0 additions & 23 deletions addons/common/functions/fnc_canUseWeapon.sqf

This file was deleted.

31 changes: 0 additions & 31 deletions addons/common/functions/fnc_selectWeaponMode.sqf

This file was deleted.

2 changes: 1 addition & 1 deletion addons/grenades/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false};
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};

// Statement
[] call FUNC(nextMode);
Expand Down
2 changes: 1 addition & 1 deletion addons/laserpointer/initKeybinds.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

[ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode);
true
Expand Down
2 changes: 1 addition & 1 deletion addons/overheating/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GVAR(cacheSilencerData) = call CBA_fnc_createNamespace;
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
if !([ACE_player] call CBA_fnc_canUseWeapon &&
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
) exitWith {false};

Expand Down
2 changes: 1 addition & 1 deletion addons/overheating/functions/fnc_jamWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GVAR(knowAboutJam) = false;
if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {

private _condition = {
[_this select 1] call EFUNC(common,canUseWeapon)
[_this select 1] call CBA_fnc_canUseWeapon
&& {currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(jammedWeapons), []])}
&& {!(currentMuzzle (_this select 1) in ((_this select 1) getVariable [QEGVAR(safemode,safedWeapons), []]))}
};
Expand Down
2 changes: 1 addition & 1 deletion addons/reload/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !(ACE_player call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false};
if !(ACE_player call CBA_fnc_canUseWeapon || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false};

// Statement
[ACE_player] call FUNC(checkAmmo);
Expand Down
2 changes: 1 addition & 1 deletion addons/safemode/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player != binocular ACE_player}) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player}) exitWith {false};

// Statement
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
Expand Down
2 changes: 1 addition & 1 deletion addons/safemode/functions/fnc_lockSafety.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then {
_unit setVariable [QGVAR(actionID), [
_unit, "DefaultAction", {
if (
[_this select 1] call EFUNC(common,canUseWeapon)
[_this select 1] call CBA_fnc_canUseWeapon
&& {
if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then {
if (inputAction "nextWeapon" > 0) exitWith {
Expand Down
16 changes: 8 additions & 8 deletions addons/weaponselect/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
Expand All @@ -21,7 +21,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
Expand All @@ -34,7 +34,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
Expand All @@ -47,7 +47,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
Expand All @@ -60,7 +60,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
Expand All @@ -73,7 +73,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, 1] call FUNC(selectNextGrenade);
Expand All @@ -86,7 +86,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
[ACE_player, 2] call FUNC(selectNextGrenade);
Expand All @@ -99,7 +99,7 @@ if (!hasInterface) exitWith {};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false};

// Statement
if ((currentWeapon ACE_player) != "") then {
Expand Down

0 comments on commit dc16136

Please sign in to comment.