Skip to content

Commit

Permalink
Added logic to detect if too close to other MHQ
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Apr 17, 2019
1 parent 5f293f3 commit 5e127aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions common/Server/mhq/tooClose.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

_tooClose = false;
_unit = (_this select 1);
{
if ((_x select 1) != _unit && (_x select 1) distance _unit <= 200) then {
if(_forEachIndex < (MHQs find _this)) then {
_tooClose = true;
}
};
} forEach MHQs;

{
if ((_x select 1) distance _unit <= 350) then {
_tooClose = true;
};
} forEach Bases;

_tooClose;
2 changes: 2 additions & 0 deletions common/initServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ if ((isnil {profilenamespace getvariable (format["Resist_SaveGame%1",savename])}
KeyNumber = (_data select 0);
};
publicVariable "KeyNumber";
tooCloseMHQ = compile preprocessFileLineNumbers 'Server\mhq\tooClose.sqf';
getContent = compile preprocessFileLineNumbers 'Server\persistance\content\getContent.sqf';
setContent = compile preprocessFileLineNumbers 'Server\persistance\content\setContent.sqf';
getSaveGame = compile preprocessFileLineNumbers 'Server\persistance\game\get_game.sqf';
setSaveGame = compile preprocessFileLineNumbers 'Server\persistance\game\set_game.sqf';
respawnMHQ = compile preprocessFileLineNumbers 'Server\mhq\respawn.sqf';


[] execVM "Server\persistance\game\keep_game.sqf";
[] execVM "Server\z_townmgr.sqf";
[] execVM "Server\mhq\marker.sqf";
Expand Down

0 comments on commit 5e127aa

Please sign in to comment.