Skip to content

Commit

Permalink
Make it legal to be at non-built outposts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparker95 committed Nov 10, 2020
1 parent 4b3dcde commit 36894e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Location/Location.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CLASS("Location", ["MessageReceiverEx" ARG "Storable"])
VARIABLE("capacityInf"); // Infantry capacity
VARIABLE("capacityHeli"); // Helicopter capacity
/* save */ VARIABLE_ATTR("capacityCiv", [ATTR_SAVE]); // Civilian capacity
/* save */ VARIABLE_ATTR("isBuilt", [ATTR_SAVE]); // true if this location has been build (used for roadblocks)
/* save */ VARIABLE_ATTR("isBuilt", [ATTR_SAVE]); // true if this location has been build
VARIABLE_ATTR("buildProgress", [ATTR_SAVE]); // How much of the location is built from 0 to 1
VARIABLE("lastBuildProgressTime"); // Time build progress was last updated
VARIABLE("buildableObjects"); // Objects that will be constructed
Expand Down Expand Up @@ -944,10 +944,7 @@ CLASS("Location", ["MessageReceiverEx" ARG "Storable"])
// have resource constraints etc. Probably it should be in Garrison.process to build
// at location when they have resources?

// Only build when the location is not spawned to avoid popin
if(!T_GETV("spawned")) then {
T_CALLM("build", []);
};
T_CALLM("build", []);

// Update player respawn rules
pr _gmdata = T_GETV("gameModeData");
Expand Down
5 changes: 5 additions & 0 deletions src/Location/isInAllowedArea.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if (_type == LOCATION_TYPE_ROADBLOCK) exitWith {
(isOnRoad _pos) || (count (_pos nearRoads 8) > 0)
};

// If this is not built, we are allowed to be here
if (!T_GETV("isBuilt")) exitWith {
true;
};

pr _areas = T_GETV("allowedAreas");

pr _index = _areas findIf {
Expand Down

0 comments on commit 36894e0

Please sign in to comment.