ACE3/addons/frag/functions/fnc_shouldSpall.sqf

29 lines
610 B
Plaintext
Raw Normal View History

2024-01-11 20:01:50 +00:00
#include "..\script_component.hpp"
/*
* Author: Lambda.Tiger
* This function checks whether an ammunition type should cause spalling.
*
* Arguments:
* 0: Ammo classname <STRING>
*
* Return Value:
2024-07-30 21:08:59 +00:00
* Whether the round type could spall when hitting an object <BOOL>
*
* Example:
2024-03-29 00:33:56 +00:00
* "B_556x45_Ball" call ace_frag_fnc_shouldSpall
*
* Public: No
*/
params ["_ammo"];
2024-07-30 18:22:52 +00:00
GVAR(shouldSpallCache) getOrDefaultCall [
_ammo,
{
(_ammo call FUNC(getSpallInfo)) params ["_caliber", "_explosive", "_indirectHit"];
2024-07-30 18:22:52 +00:00
_caliber >= 2.5 || (_explosive > 0 && _indirectHit >= 1)
},
true
]