-
Notifications
You must be signed in to change notification settings - Fork 44
Sites: Stop zone soft lock when a player 'steals' site objects. #180
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
base: development
Are you sure you want to change the base?
Changes from 1 commit
dec52c4
46f90a4
b500787
cd97f17
b23c5b1
93608f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -88,8 +88,21 @@ params ["_pos"]; | |||||||||||||||||||||||||||||||||||||||||||
| //Teardown condition | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| params ["_siteStore"]; | ||||||||||||||||||||||||||||||||||||||||||||
| //Teardown when all guns destroyed | ||||||||||||||||||||||||||||||||||||||||||||
| (_siteStore getVariable "aaGuns" findIf {alive _x} == -1) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| private _pos = getPos _siteStore; | ||||||||||||||||||||||||||||||||||||||||||||
| private _objects = _siteStore getVariable ["aaGuns", []]; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| /* | ||||||||||||||||||||||||||||||||||||||||||||
| Teardown when all guns are either | ||||||||||||||||||||||||||||||||||||||||||||
| - destroyed | ||||||||||||||||||||||||||||||||||||||||||||
| - no longer with 20m radius of site centre point | ||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| private _objectsAreAliveInRadius = _objects findIf { | ||||||||||||||||||||||||||||||||||||||||||||
| (alive _x) && (count ([_x] inAreaArray [_pos, 20, 20, 0, false]) > 0) | ||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| _objectsAreAliveInRadius == -1 | ||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be way faster to execute Below code should be faster on average:
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aye i see what you're saying, will do.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was working on an additional check for when players have loaded the site object into a vehicle with the Advanced Logistics module, as that can causes site/zone soft-locks too -- see: cd97f17 But there's at least three downstream edge cases to take into account, beyond the teardown condition check
Simplest / cleanest option seems to be to just to disable the ability to load these objects into vehicles, so that's the latest version. |
||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||
| //Teardown code | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -108,4 +121,4 @@ params ["_pos"]; | |||||||||||||||||||||||||||||||||||||||||||
| [_x] call para_s_fnc_ai_obj_finish_objective; | ||||||||||||||||||||||||||||||||||||||||||||
| } forEach (_siteStore getVariable ["aiObjectives", []]); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| ] call vn_mf_fnc_sites_create_site; | ||||||||||||||||||||||||||||||||||||||||||||
| ] call vn_mf_fnc_sites_create_site; | ||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.