ACE3/addons/common/functions/fnc_fixCollision.sqf

23 lines
552 B
Plaintext
Raw Normal View History

/*
* Author: commy2
2015-09-20 14:56:35 +00:00
* Attempt to fix PhysX collisions causing unreasonable impact forces and damage.
*
* Arguments:
2015-09-20 14:56:35 +00:00
* Object <OBJECT>
*
* Return Value:
2015-09-20 14:56:35 +00:00
* None
*
2015-09-20 14:56:35 +00:00
* Public: No
*/
#include "script_component.hpp"
// allowDamage requires local object
if (!local _this) exitWith {};
2016-01-13 00:18:12 +00:00
// prevent collision damage
[_this, "blockDamage", "fixCollision", true] call FUNC(statusEffect_set);
// re-allow damage after 2 seconds
2016-01-13 00:18:12 +00:00
[{[_this, "blockDamage", "fixCollision", false] call FUNC(statusEffect_set);}, _this, 2] call EFUNC(common,waitAndExecute);