-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from veteran29/repair-vehicle-requirement
Repair vehicle requirement
- Loading branch information
Showing
9 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
vet_unflipping_fnc_canUnflipLocal | ||
File: fn_canUnflipLocal.sqf | ||
Date: 2019-06-18 | ||
Last Update: 2019-07-18 | ||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html | ||
Description: | ||
Checks if unit can unflip the target. | ||
Parameter(s): | ||
_unit - Unit to check [OBJECT, defaults to objNull] | ||
_target - Vehicle that is unflipped [OBJECT, defaults to objNull] | ||
Returns: | ||
Target can be unflipped [BOOL] | ||
*/ | ||
params [ | ||
["_unit", objNull, [objNull]], | ||
["_target", objNull, [objNull]] | ||
]; | ||
|
||
!canMove _target | ||
&& {alive _target} | ||
&& {(vehicle _unit) isEqualTo _unit} | ||
&& {_unit call vet_unflipping_fnc_hasToolKitRequired} | ||
&& {[_unit, _target] call vet_unflipping_fnc_isServiceVehicleNearRequired} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
vet_unflipping_fnc_isRepairVehicle | ||
File: fn_isRepairVehicle.sqf | ||
Date: 2019-06-18 | ||
Last Update: 2019-06-18 | ||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html | ||
Description: | ||
Checks if vehicle is an repair vehicle. | ||
Parameter(s): | ||
_vehicle - Vehicle to check [OBJECT, defaults to objNull] | ||
Returns: | ||
Is vehicle an repair vehicle [BOOL] | ||
*/ | ||
params [ | ||
["_vehicle", objNull, [objNull]] | ||
]; | ||
|
||
if (_vehicle isKindOf "CAManBase") exitWith {false}; | ||
|
||
|
||
if (isClass(configFile >> "CfgPatches" >> "ace_repair")) then { | ||
// Value can be integer or boolean | ||
private _value = _vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "ace_repair_canRepair")]; | ||
// return | ||
_value in [1, true] | ||
} else { | ||
// return | ||
(getRepairCargo _vehicle) > 0 | ||
}; |
29 changes: 29 additions & 0 deletions
29
addons/unflipping/functions/fn_isServiceVehicleNearRequired.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
vet_unflipping_fnc_isServiceVehicleNearRequired | ||
File: fn_isServiceVehicleNearRequired..sqf | ||
Date: 2019-06-18 | ||
Last Update: 2019-07-18 | ||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html | ||
Description: | ||
Checks if the service vehicle is required, and whether or not it is nearby. | ||
Parameter(s): | ||
_unit - Unit to check [OBJECT, defaults to objNull] | ||
_target - Vehicle that is unflipped [OBJECT, defaults to objNull] | ||
Returns: | ||
Function reached the end [BOOL] | ||
*/ | ||
params [ | ||
["_unit", objNull, [objNull]], | ||
["_target", objNull, [objNull]] | ||
]; | ||
|
||
if !(vet_unflipping_require_serviceVehicle) exitWith {true}; | ||
|
||
private _nearObjects = nearestObjects [_target, ["Air", "LandVehicle", "Slingload_base_F"], 5 + sizeOf typeOf _target]; | ||
|
||
// return | ||
_nearObjects findIf {alive _x && {_x call vet_unflipping_fnc_isRepairVehicle}} != -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters