-
Notifications
You must be signed in to change notification settings - Fork 739
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 #1 from jonpas/refuelFixes
Refuel Fixes and Additions Thx @jonpas
- Loading branch information
Showing
18 changed files
with
299 additions
and
259 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,23 @@ | ||
/* | ||
* Author: Jonpas | ||
* Checks if unit can check fuel. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Can Check Fuel <BOOL> | ||
* | ||
* Example: | ||
* [unit, target] call ace_refuel_fnc_canCheckFuel | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_unit", "_target"]; | ||
|
||
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {(_target distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; | ||
|
||
true |
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
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
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,39 @@ | ||
/* | ||
* Author: GitHawk et.al., Jonpas | ||
* Returns the nozzle back to source vehicle. | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Returned Nozzle <BOOL> | ||
* | ||
* Example: | ||
* [player] call ace_refuel_fnc_returnNozzle | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
private ["_nozzle"]; | ||
|
||
params ["_unit", "_target"]; | ||
|
||
_source = _nozzle getVariable QGVAR(source); | ||
_nozzle = _unit getVariable QGVAR(nozzle); | ||
|
||
if (_source != _target || {isNil "_nozzle"}) exitWith {false}; | ||
|
||
_unit setVariable [QGVAR(nozzle), nil]; | ||
detach _nozzle; | ||
[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); | ||
_unit selectWeapon (_unit getVariable QGVAR(selectedWeaponOnRefuel)); | ||
_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; | ||
_unit setVariable [QGVAR(isRefueling), false]; | ||
|
||
_target setVariable [QGVAR(isConnected), false, true]; | ||
ropeDestroy (_nozzle getVariable QGVAR(rope)); | ||
deleteVehicle _nozzle; | ||
|
||
true |
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 |
---|---|---|
@@ -1,26 +1,20 @@ | ||
/* | ||
* Author: GitHawk | ||
* Check if a unit can turn off a fuel nozzle | ||
* Turn off a fuel nozzle | ||
* | ||
* Arguments: | ||
* 0: The unit <OBJECT> | ||
* 1: The object holding the nozzle <OBJECT> | ||
* 0: The object holding the nozzle <OBJECT> | ||
* | ||
* Return Value: | ||
* Can turn off <BOOL> | ||
* None | ||
* | ||
* Example: | ||
* [player, nozzle] call ace_refuel_fnc_canTurnOff | ||
* [player, nozzle] call ace_refuel_fnc_turnOff | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_unit", "_nozzleHolder"]; | ||
params ["_nozzleHolder"]; | ||
|
||
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || { (_nozzleHolder distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; | ||
|
||
_nozzle = _nozzleHolder getVariable QGVAR(nozzle); | ||
_nozzle setVariable [QGVAR(fueling), 0]; | ||
|
||
true | ||
(_nozzleHolder getVariable QGVAR(nozzle)) setVariable [QGVAR(fueling), 0]; |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
#include "\z\ace\addons\refuel\script_component.hpp" | ||
|
||
#define REFUEL_ACTION_DISTANCE 4.5 |
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 |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
#endif | ||
|
||
#include "\z\ace\addons\main\script_macros.hpp" | ||
|
||
|
||
#define REFUEL_ACTION_DISTANCE 7 |
Oops, something went wrong.