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:
commit
dd2767a4ec
@ -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;
|
||||
|
@ -32,6 +32,7 @@ PREP(handleScrollWheel);
|
||||
PREP(openDoor);
|
||||
|
||||
// interaction with boats
|
||||
PREP(canPush);
|
||||
PREP(push);
|
||||
|
||||
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"];
|
||||
|
||||
private "_newVelocity";
|
||||
_newVelocity = vectorDir _unit;
|
||||
private _newVelocity = vectorDir _unit;
|
||||
_newVelocity set [2, 0.25];
|
||||
_newVelocity = _newVelocity vectorMultiply 2;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user