-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
population zones (i.e. whitelisting areas) + bugfix (#55)
* fix for no position found * wait a few secs until server loop starts * `[thisTrigger] call grad_civs_fnc_addExclusionZone` <-give that a chance to run before spawning the first civs * add POPULATION_ZONES : whitelist populations zones, and restrict them with exclusion ones. default population zone is the whole map. * be explicit about empty arrays (thx @diwako)
- Loading branch information
1 parent
365ebb3
commit 41695dd
Showing
18 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "..\..\component.hpp" | ||
|
||
_this params [ | ||
["_trigger", objNull] | ||
]; | ||
|
||
if (isNull _trigger) exitWith { | ||
ERROR("got NULL instead of a trigger as parameter"); | ||
}; | ||
|
||
GVAR(POPULATION_ZONES) pushBack _trigger; | ||
|
||
INFO_2("added population zone %1 at %2", triggerArea _trigger, getPos _trigger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include "..\..\component.hpp" | ||
|
||
GRAD_CIVS_EXCLUSION_ZONES = []; | ||
GVAR(EXCLUSION_ZONES) = []; | ||
|
||
INFO("all exclusion zones removed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "..\..\component.hpp" | ||
|
||
GVAR(POPULATION_ZONES) = []; | ||
|
||
INFO("all population zones removed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
GRAD_CIVS_EXCLUSION_ZONES | ||
#include "..\..\component.hpp" | ||
|
||
GVAR(EXCLUSION_ZONES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "..\..\component.hpp" | ||
|
||
GVAR(POPULATION_ZONES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "..\..\component.hpp" | ||
|
||
params [ | ||
["_position", [0, 0, 0]] | ||
]; | ||
|
||
private _inAnyPopulationZone = if (count GVAR(POPULATION_ZONES) == 0) then { | ||
true | ||
} else { | ||
[GVAR(POPULATION_ZONES), {_position inArea (_this#0)}] call FUNC(arrayContains) | ||
}; | ||
if (!_inAnyPopulationZone) exitWith {false}; | ||
|
||
private _inAnyExclusionZone = [GVAR(EXCLUSION_ZONES), {_position inArea (_this#0)}] call FUNC(arrayContains); | ||
|
||
!_inAnyExclusionZone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters