Merge pull request #3789 from acemod/pushConfig

Add canPush config entry
This commit is contained in:
Nicolás Badano 2016-05-13 11:38:35 -03:00
commit dd2767a4ec
4 changed files with 25 additions and 3 deletions

View File

@ -420,7 +420,7 @@ class CfgVehicles {
class ACE_Push {
displayName = CSTRING(Push);
distance = 6;
condition = QUOTE(getMass _target <= 2600 && {alive _target} && {vectorMagnitude velocity _target < 3});
condition = QUOTE(_target call FUNC(canPush));
statement = QUOTE(_this call FUNC(push));
showDisabled = 0;
priority = -1;

View File

@ -32,6 +32,7 @@ PREP(handleScrollWheel);
PREP(openDoor);
// interaction with boats
PREP(canPush);
PREP(push);
PREP(switchLamp);

View File

@ -0,0 +1,22 @@
/*
* Author: Jonpas
* Checks if the boat can be pushed.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* Can Push <BOOL>
*
* Example:
* [target] call ace_interaction_fnc_canPush
*
* Public: No
*/
#include "script_component.hpp"
params ["_target"];
alive _target &&
{getMass _target <= 2600 || getNumber (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(canPush)) == 1} &&
{vectorMagnitude velocity _target < 3}

View File

@ -18,8 +18,7 @@
params ["_boat", "_unit"];
private "_newVelocity";
_newVelocity = vectorDir _unit;
private _newVelocity = vectorDir _unit;
_newVelocity set [2, 0.25];
_newVelocity = _newVelocity vectorMultiply 2;