0.3.8.0425

[Fixed] Was possible to place multiple Jammer objects.
This commit is contained in:
vbawol 2016-04-17 14:32:36 -05:00
parent bda7d50b07
commit 42fc098feb
31 changed files with 19 additions and 13 deletions

View File

@ -115,6 +115,9 @@ switch _interactOption do {
case 2: _unifiedInteract; //Drink 2
case 3: { // Build 3
closeDialog 0;
_buildingJammerRange = ["CfgEpochClient", "buildingJammerRange", 75] call EPOCH_fnc_returnConfigEntryV2;
_buildingCountLimit = ["CfgEpochClient", "buildingCountLimit", 200] call EPOCH_fnc_returnConfigEntryV2;
_buildClass = getText(configfile >> "CfgMagazines" >> _item >> "buildClass");
if (_buildClass != "") then {
_isStorage = getNumber(configfile >> "CfgMagazines" >> _item >> "isStorage");
@ -135,24 +138,27 @@ switch _interactOption do {
// base building
_pos = player modelToWorldVisual[0, 5, 0];
_pos set[2, getPosATL player select 2];
_object=createVehicle[_buildClass,_pos,[],0,"CAN_COLLIDE"];
_object setDir ((getDir player) - 180);
if (_buildClass != "PlotPole_EPOCH") then {
if (_object isKindOf "ThingX") then {
if (_buildClass isKindOf "ThingX") then {
// prevent spawning if another simulated object exists still
_otherObjects = nearestObjects[player, [_buildClass], _buildingJammerRange];
if (_otherObjects isEqualTo []) then {
_object=createVehicle[_buildClass,_pos,[],0,"CAN_COLLIDE"];
_object setDir ((getDir player) - 180);
if (([player, _item] call BIS_fnc_invRemove) == 1) then {
[_object] spawn EPOCH_simulSwap;
};
} else {
[_object,_item] spawn EPOCH_staticMove;
["<t size = '1.6' color = '#99ffffff'>Building Disallowed: Frequency Unstable</t>", 5] call Epoch_dynamicText;
};
} else {
_object spawn EPOCH_countdown;
_object=createVehicle[_buildClass,_pos,[],0,"CAN_COLLIDE"];
_object setDir ((getDir player) - 180);
[_object,_item] spawn EPOCH_staticMove;
};
// _object spawn EPOCH_countdown;
[format["<t size='1.6' color='#99ffffff'>Press '%1' to drop object.</t>", "1"], 5] call Epoch_dynamicText;
} else {
["<t size = '1.6' color = '#99ffffff'>Need Energy< / t>", 5] call Epoch_dynamicText;
};

View File

@ -1 +1 @@
build=424;
build=425;

View File

@ -1 +1 @@
build=424;
build=425;

View File

@ -1 +1 @@
build=424;
build=425;

View File

@ -1 +1 @@
build=424;
build=425;

View File

@ -1 +1 @@
424
425