-
Notifications
You must be signed in to change notification settings - Fork 735
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
Add - Iron dome for defending against projectiles #10038
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,7 @@ | |||
#include "script_component.hpp" | |||
|
|||
if (isServer && { GVAR(enable) }) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A boolean check is too cheap for lazy eval.
I just tested that without lazy eval (isServer && true
) it takes 0.0011ms - 0.0027ms, whereas with lazy eval (isServer && {true}
) it always takes at least 0.0015ms (most of the time), sometimes up to 0.0045ms.
if (isServer && { GVAR(enable) }) then { | |
if (isServer && GVAR(enable)) then { |
|
||
GVAR(interceptors) = []; | ||
// Put these into hash table to avoid massive amounts of loops | ||
GVAR(toBeShot) = call CBA_fnc_hashCreate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HashMaps are in vanilla already, though.
Iron Dome fires two missiles per threat. Why not a CBA state machine? |
When merged this pull request will:
Missiles will automatically track threats and kill them when they enter a "defend" radius. The missiles are managed by a "commander" state machine, and only one missile will be assigned to each threat.
The API is kinda shitty, and I would like feedback on how to improve.
I hate that I separated this PR after the recent political situation, but it is a cool system for ARMA missions
Merge Strategy
Follow #10019
IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.