Selectable Plots- Fix #2

This commit is contained in:
He-Man 2019-02-27 00:18:26 +01:00
parent ea7bc08a8c
commit 82fcd99c98
3 changed files with 17 additions and 4 deletions

View File

@ -69,7 +69,7 @@ if (isText _staticClassConfig) then {
} else {
// TODO: optimize by using config var
if (_vehicle isKindOf "ThingX" || _vehicle isKindOf "Const_Ghost_EPOCH" || ({_vehicle isKindOf _x} count (call EPOCH_JammerClasses) > -1)) then {
if (_vehicle isKindOf "ThingX" || _vehicle isKindOf "Const_Ghost_EPOCH" || ({_vehicle isKindOf _x} count (call EPOCH_JammerClasses) > 0)) then {
_objSlot = _vehicle getVariable["BUILD_SLOT", -1];
if (_objSlot == -1) then{
@ -100,7 +100,8 @@ if (isText _staticClassConfig) then {
else {
_newVehicle setVariable["BUILD_OWNER", _playerUID, true];
};
if ({_newVehicle isKindOf _x} count (call EPOCH_JammerClasses) > -1) then {
if ({_newVehicle isKindOf _x} count (call EPOCH_JammerClasses) > 0) then {
EPOCH_Plotpoles = EPOCH_Plotpoles - [ObjNull];
EPOCH_Plotpoles pushBackUnique _newVehicle;
publicvariable "EPOCH_Plotpoles";
};

View File

@ -1,6 +1,6 @@
// _newObj = [_class,_object] call EPOCH_swapBuilding;
//[[[cog import generate_private_arrays ]]]
private ["_newObj","_objectPos","_owner"];
private ["_newObj","_objectPos","_owner","_UpdatePlots"];
//[[[end]]]
params [["_class",""],["_object",objNull],["_method",0]];
_newObj = objNull;
@ -12,6 +12,18 @@ if (!isNull _object && !(_class isEqualTo "")) then {
if !(_owner isEqualTo "") then {
_newObj setVariable ["BUILD_OWNER", _owner, true];
};
_UpdatePlots = false;
if (_object in EPOCH_Plotpoles) then {
EPOCH_Plotpoles = EPOCH_Plotpoles - [_object];
_UpdatePlots = true;
};
if (_class in (call EPOCH_JammerClasses)) then {
EPOCH_Plotpoles pushback _newObj;
_UpdatePlots = true;
};
if (_UpdatePlots) then {
publicvariable 'EPOCH_Plotpoles';
};
_object hideObjectGlobal true;
switch (_method) do {
case 0: {

View File

@ -422,7 +422,7 @@ for "_i" from 1 to 3 do {
};
if ("MAP-BASEBUILDING" in _case) then {
_temp = _temp + "
,[' Base Building Marker', [], {"+_skn_tg_map_basebuilding+" = !"+_skn_tg_map_basebuilding+"; if ("+_skn_tg_map_basebuilding+") then {waitUntil {"+_skn_mapBasesArray+" = Epoch_PlotPoles;uiSleep 15;!"+_skn_tg_map_basebuilding+"};"+_skn_mapBasesArray+" = []}; ['Base Building MARKER',if ("+_skn_tg_map_basebuilding+") then [{2},{1}]] call "+_skn_adminLog_PVC+"}, '2', []]
,[' Base Building Marker', [], {"+_skn_tg_map_basebuilding+" = !"+_skn_tg_map_basebuilding+"; if ("+_skn_tg_map_basebuilding+") then {waitUntil {"+_skn_mapBasesArray+" = (Epoch_PlotPoles - [objnull]);uiSleep 15;!"+_skn_tg_map_basebuilding+"};"+_skn_mapBasesArray+" = []}; ['Base Building MARKER',if ("+_skn_tg_map_basebuilding+") then [{2},{1}]] call "+_skn_adminLog_PVC+"}, '2', []]
";
};
};