ACE3/addons/refuel/script_component.hpp
jonpas 711e1fc026 Fix Underwater interactions (magrepack, loading, refuel, medical legs, dragging) (#5521)
* Fix Magazine Repack underwater - fix #5513
Also prevent common goKneeling function underwater

* Fix loading patients underwater - fix #5515

* Fix load object underwater

* Fix take nozzle on jerry can underwater

* Fix refuel underwater conditions further

* Use isTouchingGround, Make refuel semi-compatible
 reports false if head is out of the water, we want true even if we are not diving

* Less interact exceptions duplication

* Use animationState to determine if unit is swimming, create common function and use it instead of isTouchingGround

* Fix condition

* Support dragging underwater
No carrying due to animation timing issues and other misc things

* Allow Medical Legs SelfActions underwater

* Fix fixPosition function underwater (use getPosATL instead of getPos)

* Fix fixPosition's slope adjustment for non-gravity objects, Do the same for objects without simulation as well
2017-10-01 13:38:11 -05:00

35 lines
916 B
C++

#define COMPONENT refuel
#define COMPONENT_BEAUTIFIED Refuel
#include "\z\ace\addons\main\script_mod.hpp"
// #define FAST_PROGRESSBARS
// #define DRAW_HOOKS_POS
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_REFUEL
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_REFUEL
#define DEBUG_SETTINGS DEBUG_ENABLED_REFUEL
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define REFUEL_INFINITE_FUEL -10
#define REFUEL_DISABLED_FUEL -1
#define REFUEL_ACTION_DISTANCE 7
#define REFUEL_NOZZLE_ACTION_DISTANCE 2
#define REFUEL_PROGRESS_DURATION 2
#ifdef FAST_PROGRESSBARS
#define TIME_PROGRESSBAR(X) ((X) * 0.075)
#else
#define TIME_PROGRESSBAR(X) (X)
#endif
#define INTERACT_EXCEPTIONS_REFUELING "isNotInside", "isNotOnLadder", "isNotSwimming"
#define INTERACT_EXCEPTIONS INTERACT_EXCEPTIONS_REFUELING, "isNotRefueling"