Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frag - Add public blacklist interface #10163

Merged
merged 364 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
364 commits
Select commit Hold shift + click to select a range
ea654c8
Capitalized config entries
lambdatiger Jan 15, 2024
4dee712
fixed example syntax
lambdatiger Jan 15, 2024
81d477e
fixed call syntax
lambdatiger Jan 15, 2024
29d3d4c
alphabetized PREP instead of categorizing it
lambdatiger Jan 15, 2024
c7a2769
Really obvious isNull instead of isEqualTo
lambdatiger Jan 15, 2024
8683e0a
Fixed array of double spaced format errors
lambdatiger Jan 15, 2024
fa4de59
renamed files to fit proper format
lambdatiger Jan 15, 2024
96dc215
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 15, 2024
054b9cd
fixed more spacing issues
lambdatiger Jan 15, 2024
c05be02
formatting
lambdatiger Jan 15, 2024
3957a07
Fixed debug mode init, a few things pointed out by johnb432 that I wa…
lambdatiger Jan 15, 2024
3874146
formatting
lambdatiger Jan 15, 2024
133f0b1
Updated type checks in line with recommendation from johnb432
lambdatiger Jan 15, 2024
dd7fc86
fixed comment to properly state variable purpose
lambdatiger Jan 15, 2024
6fc950a
Comments fixed
lambdatiger Jan 15, 2024
6e209ba
slight performance increase using forEach loops
lambdatiger Jan 15, 2024
d683be8
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 15, 2024
4ef1166
Small optimization to optimize config lookup
lambdatiger Jan 16, 2024
902af64
avoid mismatch sides when debugging frags with unconcious or captive …
lambdatiger Jan 16, 2024
bd33ab0
removed return of sphere object, not required or useful.
lambdatiger Jan 16, 2024
e3c8e8d
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 16, 2024
f713791
fixed a loop that got caught in the merge crossfire
lambdatiger Jan 16, 2024
a8e268c
Optimized approach to classifying blacklist type
lambdatiger Jan 16, 2024
c4a93c7
Implemented changes discussed here https://github.com/acemod/ACE3/pul…
lambdatiger Jan 16, 2024
b2666fc
Config lookup optimization mentioned by johnb432 here: https://github…
lambdatiger Jan 16, 2024
b780704
white space/formatting changes
lambdatiger Jan 16, 2024
67e125c
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 16, 2024
85b566a
removed old parameter changed in https://github.com/acemod/ACE3/pull/…
lambdatiger Jan 16, 2024
67ede76
compacted text a bit
lambdatiger Jan 16, 2024
572f909
formatting whitespace
lambdatiger Jan 16, 2024
7aa17aa
Grammatical erros
lambdatiger Jan 16, 2024
8dd76d1
Changes as discussed here https://github.com/acemod/ACE3/pull/9728#di…
lambdatiger Jan 16, 2024
6dacd38
Few quick optimizations of == to isEqualTo
lambdatiger Jan 16, 2024
9178611
Debug updated to be easier to control
lambdatiger Jan 16, 2024
769bb29
Changed how spall hold off is calculated to avoid repeated unneeded c…
lambdatiger Jan 16, 2024
63cba6b
clarified a hold off variable
lambdatiger Jan 16, 2024
4be8c82
Better approach to ACE_FRAG_RM_EH macro
lambdatiger Jan 17, 2024
4727386
Git rid of superfulous stringtable entries
lambdatiger Jan 17, 2024
16e699e
unneeded parens
lambdatiger Jan 18, 2024
cdf1b4d
Clarified arguments
lambdatiger Jan 18, 2024
1b03ef7
getposATL to getPosATL
lambdatiger Jan 18, 2024
0958d6a
Update addons/frag/functions/fnc_dev_addRound.sqf
lambdatiger Jan 18, 2024
1612872
Function header changes
lambdatiger Jan 18, 2024
3cc300a
another great isNotEqualTo opportunity
lambdatiger Jan 18, 2024
b6891b7
formatting changes
lambdatiger Jan 18, 2024
e5f62c7
unneeded parens
lambdatiger Jan 18, 2024
c0c423b
Declared _ammoInfo twice
lambdatiger Jan 18, 2024
5160361
optimized around checking if systems are active and moved debug argum…
lambdatiger Jan 18, 2024
73d0064
Removed white space from removing an if statement in a previous commit
lambdatiger Jan 18, 2024
ea15eea
Removed superfulous parenthese
lambdatiger Jan 18, 2024
a1c498d
clarified function description and removed unneeded comments
lambdatiger Jan 18, 2024
0321b78
Moved "isServer" check to initRound function
lambdatiger Jan 18, 2024
1f294f5
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 18, 2024
3f84a45
https://github.com/acemod/ACE3/pull/9728#discussion_r1454832701
lambdatiger Jan 18, 2024
da1d184
changed params statement, function header, and propigated doFrag argu…
lambdatiger Jan 18, 2024
183d9f0
capitization from cfg to Cfg in config lookups
lambdatiger Jan 18, 2024
df884dc
changed default arguments, check isKindOf to "CAManBase"
lambdatiger Jan 18, 2024
8b45d0a
Updated function headers
lambdatiger Jan 18, 2024
9bcf2b7
white space and define placement changes
lambdatiger Jan 18, 2024
35592fa
removed 2 argument option and removed some defaults
lambdatiger Jan 18, 2024
63d67df
removed spurious commas
lambdatiger Jan 18, 2024
c921b1f
removed unused debug GVAR
lambdatiger Jan 18, 2024
13834d7
Switched debug clear traces from addAction to ACE self interact
lambdatiger Jan 18, 2024
85df838
variable names weren't verbose enough
lambdatiger Jan 18, 2024
f741737
Mactched format https://github.com/acemod/ACE3/pull/9728#discussion_r…
lambdatiger Jan 18, 2024
a4f2ad4
Updated debug settings
lambdatiger Jan 18, 2024
59bf6e3
Shot parent possible fix #1
lambdatiger Jan 18, 2024
722e86a
Removed extra text from CfgAmmoFragParameters
lambdatiger Jan 18, 2024
4ebbc28
Makes sure spall power square root is positive and also we don't prod…
lambdatiger Jan 18, 2024
8b3826a
white space for clarity
lambdatiger Jan 18, 2024
78a15b1
Optimize dev_hitbox deleting
lambdatiger Jan 18, 2024
5f1cf0b
saving people from their own bad testing setup
lambdatiger Jan 18, 2024
f3788af
Since the functions always exist, I guess these variables should too
lambdatiger Jan 18, 2024
a3efede
Fixe bad search function
lambdatiger Jan 18, 2024
8636926
optimization, see https://github.com/acemod/ACE3/pull/9728#discussion…
lambdatiger Jan 19, 2024
00dc419
changed SPG-9 Fragments
lambdatiger Jan 19, 2024
2d9828d
removed unneeded toLower
lambdatiger Jan 19, 2024
40b9cd3
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jan 19, 2024
2e6186c
Changed case output to match config
lambdatiger Jan 19, 2024
33afd8a
Merge branch 'ACE_advancedThrowing-shotParent-issue'
lambdatiger Jan 21, 2024
3540062
Increased relative chance to hit torso/pelvis when fragemnt should hit.
lambdatiger Jan 21, 2024
fd6b9bc
Removed double space
lambdatiger Jan 21, 2024
07f055e
updated some round types
lambdatiger Feb 8, 2024
f63b408
Added commented 2.18 commands and updated script component
lambdatiger Feb 8, 2024
60543a5
added print incomplete only option to fnc_debugAmmo
lambdatiger Feb 8, 2024
2ad2564
removed all spaces from macros
lambdatiger Feb 8, 2024
49c6187
Sync main repo
lambdatiger Feb 8, 2024
a4c88ec
removd unneeded define
lambdatiger Feb 8, 2024
665707b
a Brett (HEMTT) suggested change I miss
lambdatiger Feb 8, 2024
1da1c68
Apply suggestions from code review
lambdatiger Feb 14, 2024
fa241ca
Removed doublespace
lambdatiger Feb 14, 2024
61029ba
Update addons/frag/functions/fnc_dev_addRound.sqf
lambdatiger Feb 14, 2024
4d9f61e
Update addons/frag/functions/fnc_dev_drawTrace.sqf
lambdatiger Feb 15, 2024
ae116e2
variable name changes
lambdatiger Feb 15, 2024
a976b28
magic number clean up and white space
lambdatiger Feb 15, 2024
4ef23df
white space, function headers and variable names
lambdatiger Feb 15, 2024
bc2a6bb
small Should spall optimization
lambdatiger Feb 15, 2024
7e54280
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Feb 15, 2024
668d222
Removed blacklist functions and settings
lambdatiger Feb 16, 2024
c09c2a1
reformatted function headers, removed value type checking, and change…
lambdatiger Feb 16, 2024
656fa9f
fixed missing underscore in change from review
lambdatiger Feb 16, 2024
78a27ff
function header, lazy eval, and params list simplifications
lambdatiger Feb 16, 2024
dfdea2d
function header and variable name readability
lambdatiger Feb 16, 2024
6cbfe15
changed defaults to make them more clear they're just a default value
lambdatiger Feb 16, 2024
21e7b3d
Updated wiki to be clearer in a few areas, and add some other informa…
lambdatiger Feb 16, 2024
4913887
added MP debug compatability
lambdatiger Feb 16, 2024
66c566b
Possible shouldFrag legibility improvement
lambdatiger Feb 16, 2024
a8778a6
added changes to stringtable
lambdatiger Feb 16, 2024
f4dc052
Grammar sweep on the wiki, and added some clarifications to config va…
lambdatiger Feb 16, 2024
7248496
optimized dev_trackHitbox and made variables more explicit
lambdatiger Feb 16, 2024
4728a56
Cleaned up documentation and documentation
lambdatiger Feb 16, 2024
008328c
reorganized postInit CBA_settingInitialized EH
lambdatiger Feb 16, 2024
dd65fc8
missing underscore in fnc_dev_trackObj
lambdatiger Feb 17, 2024
c3470de
stopped adding unneeded extra points
lambdatiger Feb 17, 2024
b98aae7
cleaned un-updated stringtable entries
lambdatiger Feb 17, 2024
05dedff
reworked some function headers and deleted whitespace in doFragTargeted
lambdatiger Feb 21, 2024
776c1f7
Merge branch 'acemod:master' into master
lambdatiger Feb 21, 2024
fc745e4
Removed outdated code
johnb432 Mar 1, 2024
279f2e0
Formatting and header fixes
johnb432 Mar 1, 2024
480d2df
Ignore curators and spectators
johnb432 Mar 1, 2024
d6c21e0
Made clear traces global again, added interaction condition
johnb432 Mar 2, 2024
d6a37f3
Change stringtable entries
johnb432 Mar 2, 2024
e3395c5
Removed unused stringtable entries & fixed hitbox description
lambdatiger Mar 2, 2024
f57ac94
Small coding standard changes (missing semicolons on non-return valu…
lambdatiger Mar 2, 2024
8a2f40c
Changed sphere size and added return based on usage in dev_trackHitBox
lambdatiger Mar 3, 2024
3cb07e8
removed "_lo" random fragment entries as they are unused
lambdatiger Mar 3, 2024
3e52ce2
doFragRandom was always being called and spawning at least 5 fragment…
lambdatiger Mar 3, 2024
5915d0e
removed unnceassary "disableCollisionWith"
lambdatiger Mar 3, 2024
4c905fe
Clarified trace statements and corrected format and spelling
lambdatiger Mar 3, 2024
9c6a919
Do spall exits for time 90% of the time (round hits multiple walls) a…
lambdatiger Mar 3, 2024
fd2c595
Fixed ordering in which frag hold off variables are set to not skip w…
lambdatiger Mar 3, 2024
98caad5
initRound ordering and fixed define names
lambdatiger Mar 3, 2024
ff98917
Fixed function header
lambdatiger Mar 3, 2024
4583a0d
reformatted comments and some v2.18 remakrs comments
lambdatiger Mar 3, 2024
deecaf9
Removed unneeded ground offset
lambdatiger Mar 5, 2024
448f3e8
Merge remote-tracking branch 'upstream/master'
lambdatiger Mar 10, 2024
9dd45e1
Expanded TRACE
johnb432 Mar 13, 2024
ab51d8f
Fix typo
johnb432 Mar 13, 2024
04a3ba8
Moved event to preInit
johnb432 Mar 17, 2024
786ce92
Updated default fallback frag distance to be less extreme and changed…
lambdatiger Mar 17, 2024
48f96b4
Merge branch 'acemod:master' into master
lambdatiger Mar 18, 2024
e1d085c
Merge branch 'acemod:master' into master
lambdatiger Mar 22, 2024
eda865f
Randomized random frag directions
lambdatiger Mar 29, 2024
5bab127
removed some magic numbers, and cached numbers from shouldSpall
lambdatiger Mar 29, 2024
ef39e78
removed magic numbers and cached values preemptively (normally spallI…
lambdatiger Mar 29, 2024
c487f7f
Unify example formatting
lambdatiger Mar 29, 2024
5e41b51
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Mar 29, 2024
bd23b42
cleaned up function examples
lambdatiger Mar 29, 2024
a817e5e
removed excess square brackets
lambdatiger Mar 29, 2024
0800205
Final function example reformat
lambdatiger Mar 29, 2024
60d0af8
Update addons/frag/script_component.hpp
johnb432 Mar 29, 2024
ecf5dbf
Merge branch 'master' into pr/9728
johnb432 Mar 29, 2024
6b82859
Corrected docs
johnb432 Apr 1, 2024
e8283c3
Use `getOrDefaultCall`
johnb432 Apr 1, 2024
6c53fff
Merge branch 'acemod:master' into master
lambdatiger Apr 4, 2024
2206ef4
Removed unused classes, redefined using macros to minimize error and …
lambdatiger Apr 14, 2024
25f14af
updated debugging output and fixed velocity error
lambdatiger Apr 14, 2024
eb24c11
Reformatted for legibility and debug output
lambdatiger Apr 14, 2024
3c2a3c7
caught calc error while answer johnb's question
lambdatiger Apr 14, 2024
ce60bd3
Almost finished with compats and I had some changes to align vanilla …
lambdatiger Apr 14, 2024
d6c400e
Missed variable when updating
lambdatiger Apr 14, 2024
283b806
Added unneeded class details to make PBOproject happy
lambdatiger Apr 14, 2024
868c613
Forgot to update doFragRandom docs with previous changes
lambdatiger Apr 14, 2024
559c611
and the debug context
lambdatiger Apr 14, 2024
afc3b10
Merge branch 'acemod:master' into master
lambdatiger Apr 16, 2024
4f0c167
Merge branch 'master' into pr/9728
johnb432 May 9, 2024
e2dce5e
Readd blacklist
johnb432 May 18, 2024
b9aa3cb
Fixed an issue with fragments being created above water for explosion…
lambdatiger May 19, 2024
eaff498
Exposed projectile event handlers for both blacklist use and other sh…
lambdatiger May 19, 2024
f1483c5
Revert "Exposed projectile event handlers for both blacklist use and …
lambdatiger May 19, 2024
8d071f9
added debug information and folded if statements
lambdatiger May 19, 2024
3d6c406
fixed error (if statement with no argument)
lambdatiger May 19, 2024
718c3d6
Only send blacklist updates to the server
lambdatiger May 20, 2024
130037d
Added default fragCount fallback value based on current ACE frag rang…
lambdatiger Jun 20, 2024
474321b
Converted all positions for doFrag to AGL since we're converting to t…
lambdatiger Jun 20, 2024
60a0dae
removed feet hitpoints & tightened multishot submunitions.
lambdatiger Jun 20, 2024
d0df8e5
Merge branch 'acemod:master' into master
lambdatiger Jun 20, 2024
eedbb0b
Revert to 60a0dae, merge conflict wasn't resolved properly
lambdatiger Jun 20, 2024
7050afb
Merge branch 'master' of https://github.com/lambdatiger/ace_frag-over…
lambdatiger Jun 20, 2024
d6adfb7
Merge remote-tracking branch 'upstream/master'
lambdatiger Jun 20, 2024
a6cfcbf
Removed event handlers
lambdatiger Jul 17, 2024
cf1860d
Changed blacklist to acting on local projectiles to match initial per…
lambdatiger Jul 17, 2024
9df2e5b
added fired EH and moved projectile tracking to be local to projectile
lambdatiger Jul 17, 2024
f65fcbf
updated initialization and should frag to check for submunitions sinc…
lambdatiger Jul 17, 2024
cd4d2a9
Fixed calls for shouldFrag and got rid of old initRound.sfq (maybe ba…
lambdatiger Jul 17, 2024
04e844f
fixed small mistakes in names and function calls
lambdatiger Jul 17, 2024
1ae4fc7
fixed frame offset to avoid hitting dead targets
lambdatiger Jul 17, 2024
15d5256
Merge branch 'acemod:master' into master
lambdatiger Jul 17, 2024
32af820
Fixed config path in shouldFrag
lambdatiger Jul 17, 2024
0269039
Didn't know that PBO project needed trailing {} on class inheritance …
lambdatiger Jul 17, 2024
15de0d9
fixed more useless trailing {}
lambdatiger Jul 17, 2024
b656ef6
Initial rollback to old frag simulation and spalling simulation. Upda…
lambdatiger Jul 17, 2024
2c5b058
missed comma
lambdatiger Jul 17, 2024
20b1ab7
remove fragCount from config
lambdatiger Jul 17, 2024
a20274a
made addBlackList remove projectile EHs
lambdatiger Jul 18, 2024
842b818
updated config path to be relevant to post-EH version
lambdatiger Jul 18, 2024
fbca983
All spalling in current version is local
lambdatiger Jul 18, 2024
04c4bd4
updated search pattern to one discussed in PR #9728
lambdatiger Jul 19, 2024
682568f
updated defines to match implementation
lambdatiger Jul 19, 2024
9c8e9e3
removed commented out debug information from nouber
lambdatiger Jul 19, 2024
3fcf6f7
removed magic numbers and code with no effect
lambdatiger Jul 19, 2024
3595f82
removed more magic numbers
lambdatiger Jul 19, 2024
39e7f7f
unfucked a comma
lambdatiger Jul 19, 2024
783c2aa
fixed debug def names
lambdatiger Jul 19, 2024
f7d6c78
updated documentation
lambdatiger Jul 19, 2024
8da5e47
changed debug colors
lambdatiger Jul 19, 2024
437f6c1
mass must be in grams in this version I guess
lambdatiger Jul 19, 2024
48e2996
fixed errors in frag with downgrade
lambdatiger Jul 19, 2024
1480715
fixed timing and other spall issues
lambdatiger Jul 19, 2024
4f25176
updated some defne names and usages
lambdatiger Jul 19, 2024
c344130
increased code legiblity and optimized some randomizations
lambdatiger Jul 19, 2024
f57f6f5
clarified parts of the spall event chain
lambdatiger Jul 19, 2024
2713acd
Optimized loop to find spall position using larger steps and fewer op…
lambdatiger Jul 19, 2024
e4d36c6
fixed small errors
lambdatiger Jul 19, 2024
160bb15
Merge remote-tracking branch 'upstream/master' into Event-hanlder-rep…
lambdatiger Jul 19, 2024
3efaef0
removed unused variables & EHs and set defaults in the case debug mod…
lambdatiger Jul 30, 2024
6137849
removed "class eventhandler" references
lambdatiger Jul 30, 2024
5df635c
removed _fragCount reference in newly backported debug functions
lambdatiger Jul 30, 2024
33a0653
fragmenting projectile velocity isn't used anywhere
lambdatiger Jul 30, 2024
72a6cff
removed unused variables, implemented fixes from full rewrite PR, and…
lambdatiger Jul 30, 2024
3659aff
added debug draw mode to DEBUG_ENABLED_FRAG define check
lambdatiger Jul 30, 2024
8b29b86
Merge branch 'acemod:master' into Event-hanlder-replacement
lambdatiger Jul 30, 2024
06d3b23
fix documentation to make units clear on metal and filler quanities
lambdatiger Jul 30, 2024
4d79e93
Merge branch 'Event-hanlder-replacement' of https://github.com/lambda…
lambdatiger Jul 30, 2024
0ef3991
command capitalization
lambdatiger Jul 30, 2024
cfdf291
added target point debug spheres
lambdatiger Jul 30, 2024
5745455
fixed target sphere visability
lambdatiger Jul 30, 2024
bee8eee
Jank fix so that the unit firing can get hit with it's own fragments
lambdatiger Jul 30, 2024
5059cb2
accidentally committed script_component.hpp w/ debug enabled
lambdatiger Jul 30, 2024
ed36b6a
Alternative way to address shot parent self-harm issue
lambdatiger Jul 30, 2024
61a1770
missed comma, going to bed, sorry
lambdatiger Jul 30, 2024
7b282ec
add newline and fix blacklist
lambdatiger Jul 30, 2024
22ca38f
legability formatting
lambdatiger Jul 30, 2024
25cc22b
removed extra newlines and double spaces
lambdatiger Jul 30, 2024
2e67d5d
Updated function documentation
lambdatiger Jul 30, 2024
4092177
Removed unused stringtable items
lambdatiger Jul 30, 2024
8c68f13
Debug sphere conditional was missing in frago
lambdatiger Jul 31, 2024
afd99c7
Added class blacklisting functionality
lambdatiger Aug 3, 2024
0a9119b
Converted addBlacklist function to be public
lambdatiger Aug 3, 2024
43b764c
fixed glaring error
lambdatiger Aug 14, 2024
f2d6e77
Reformatted to be more concise and added argument defaults.
lambdatiger Aug 14, 2024
a7c4631
Deleted one sentence too many
lambdatiger Aug 14, 2024
a487b97
Merge branch 'acemod:master' into Frag-public-blacklist-functions
lambdatiger Aug 15, 2024
679405d
Merge remote-tracking branch 'upstream/master' into Frag-public-black…
lambdatiger Sep 4, 2024
251bc00
Fixed info macro usage
lambdatiger Sep 4, 2024
98e0029
Forgot to consider someone might have explosion reflections on but no…
lambdatiger Sep 4, 2024
5f9c3b7
Merge remote-tracking branch 'upstream/master' into Frag-public-black…
lambdatiger Sep 18, 2024
dbbd1ae
Fix some post merge errors
lambdatiger Sep 18, 2024
c67ec28
missed a few more merge errors
lambdatiger Sep 18, 2024
aa50b3f
renamed classBlacklist function
lambdatiger Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/frag/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ PREP(fired);
PREP(frago);
PREP(getFragInfo);
PREP(getSpallInfo);
PREP(setClassBlacklisted);
PREP(shouldFrag);
PREP(shouldSpall);
24 changes: 16 additions & 8 deletions addons/frag/functions/fnc_addBlacklist.sqf
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
#include "..\script_component.hpp"
/*
* Author: Jaynus, NouberNou
* Author: Jaynus, NouberNou, Lambda.Tiger
* Adds a round to the blacklist (will be ignored) and removes any ace_frag event handlers added to it.
* Once blacklisted a projectile can not be "unblacklisted."
*
* Arguments:
* 0: Projectile <OBJECT>
* 0: Projectile to be blacklisted <OBJECT>
*
* Return Value:
* None
* Was the projectile blacklisted <BOOL>
*
* Example:
* [_projectile] call ace_frag_fnc_addBlackList
*
* Public: No
* Public: Yes
*/

params ["_projectile"];
params [["_projectile", objNull, [objNull]]];
TRACE_2("addBlackList",_projectile,typeOf projectile);

_projectile setVariable [QGVAR(blacklisted), true];
_projectile removeEventHandler ["HitPart", _projectile getVariable [QGVAR(hitPartEventHandler), -1]];
if (isNull _projectile || {!isClass (configFile >> "CfgAmmo" >> (typeOf _projectile))}) exitWith {
TRACE_1("Invalid projectile",_this);
false;
};

nil // return
_projectile setVariable [QGVAR(blacklisted), true];
_projectile removeEventHandler [
"HitPart",
_projectile getVariable [QGVAR(hitPartEventHandler), -1]
];
true;
49 changes: 49 additions & 0 deletions addons/frag/functions/fnc_setClassBlacklisted.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "..\script_component.hpp"
/*
* Author: Lambda.Tiger
* Blacklist an ammo class preventing it from producing fragments and/or spall.
* This function will not allow you to force a projectile to produce fragments or spall.
* Once an ammo class has been blacklisted, it can be removed from the blacklist using this function without restarting the mission.
*
* Arguments:
* 0: Class name of the ammo to be blacklisted <STRING>
* 1: Should a projectile be blacklisted from producing fragments <BOOL> (default: true)
* 2: Should a projectile be blacklisted from producing spall <BOOL> (default: true)
*
* Return Value:
* Were the changes properly applied <BOOL>
*
* Example:
* // Stop "ACE_20mm_HE" from producing spall
* ["ACE_20mm_HE", false, true] call ace_frag_fnc_setClassBlacklisted;
*
* Public: Yes
*/
params [
["_ammo", "", [""]],
["_blacklistFrag", true, [true]],
["_blacklistSpall", true, [true]]
];
TRACE_3("addBlackListClass",_ammo,_blacklistFrag,_blacklistSpall);

if (_ammo isEqualTo "" || {!isClass (configFile >> "CfgAmmo" >> _ammo)}) exitWith {
INFO_1("Invalid ammo class [%1]",_ammo);
false
};

if (_blacklistFrag) then {
GVAR(shouldFragCache) set [_ammo, false];
} else {
GVAR(shouldFragCache) deleteAt _ammo;
_ammo call FUNC(shouldFrag);
};


if (_blacklistSpall) then {
GVAR(shouldSpallCache) set [_ammo, false];
} else {
GVAR(shouldSpallCache) deleteAt _ammo;
_ammo call FUNC(shouldSpall);
};

true
Loading