1
0
mirror of https://github.com/acemod/ACE3.git synced 2024-08-30 18:23:18 +00:00
ACE3/addons/common/functions/fnc_fixCollision.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes ()
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

26 lines
606 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2
* Attempt to fix PhysX collisions causing unreasonable impact forces and damage.
*
* Arguments:
* Object <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ace_common_fnc_fixCollision
*
* Public: No
*/
// allowDamage requires local object
if (!local _this) exitWith {};
// prevent collision damage
[_this, "blockDamage", "fixCollision", true] call FUNC(statusEffect_set);
// re-allow damage after 2 seconds
[{[_this, "blockDamage", "fixCollision", false] call FUNC(statusEffect_set);}, _this, 2] call CBA_fnc_waitAndExecute;