mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3789 from acemod/pushConfig
Add canPush config entry
This commit is contained in:
@ -420,7 +420,7 @@ class CfgVehicles {
|
|||||||
class ACE_Push {
|
class ACE_Push {
|
||||||
displayName = CSTRING(Push);
|
displayName = CSTRING(Push);
|
||||||
distance = 6;
|
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));
|
statement = QUOTE(_this call FUNC(push));
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = -1;
|
priority = -1;
|
||||||
|
@ -32,6 +32,7 @@ PREP(handleScrollWheel);
|
|||||||
PREP(openDoor);
|
PREP(openDoor);
|
||||||
|
|
||||||
// interaction with boats
|
// interaction with boats
|
||||||
|
PREP(canPush);
|
||||||
PREP(push);
|
PREP(push);
|
||||||
|
|
||||||
PREP(switchLamp);
|
PREP(switchLamp);
|
||||||
|
22
addons/interaction/functions/fnc_canPush.sqf
Normal file
22
addons/interaction/functions/fnc_canPush.sqf
Normal 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}
|
@ -18,8 +18,7 @@
|
|||||||
|
|
||||||
params ["_boat", "_unit"];
|
params ["_boat", "_unit"];
|
||||||
|
|
||||||
private "_newVelocity";
|
private _newVelocity = vectorDir _unit;
|
||||||
_newVelocity = vectorDir _unit;
|
|
||||||
_newVelocity set [2, 0.25];
|
_newVelocity set [2, 0.25];
|
||||||
_newVelocity = _newVelocity vectorMultiply 2;
|
_newVelocity = _newVelocity vectorMultiply 2;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user