mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
0.3.8.0436
omit active simulSwap target from is build allowed check return items if object it removed
This commit is contained in:
parent
14ea6a44dc
commit
b2cfa0e0bc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -40,6 +40,11 @@ if (_buildingCountLimit == 0) then { _buildingCountLimit = 200; };
|
|||||||
|
|
||||||
// input
|
// input
|
||||||
params ["_objType"];
|
params ["_objType"];
|
||||||
|
_obj = objNull;
|
||||||
|
if (_objType isEqualType objNull) then {
|
||||||
|
_obj = _objType;
|
||||||
|
_objType = typeOf _objType;
|
||||||
|
};
|
||||||
|
|
||||||
_staticClass = getText(configfile >> "CfgVehicles" >> _objType >> "staticClass");
|
_staticClass = getText(configfile >> "CfgVehicles" >> _objType >> "staticClass");
|
||||||
_simulClass = getText(configfile >> "CfgVehicles" >> _objType >> "simulClass");
|
_simulClass = getText(configfile >> "CfgVehicles" >> _objType >> "simulClass");
|
||||||
@ -83,9 +88,12 @@ if !(_buildingAllowed)exitWith{ false };
|
|||||||
// Max object
|
// Max object
|
||||||
if (!_ownedJammerExists) then{
|
if (!_ownedJammerExists) then{
|
||||||
_limitNearby = getNumber(configfile >> "CfgVehicles" >> _staticClass >> "limitNearby");
|
_limitNearby = getNumber(configfile >> "CfgVehicles" >> _staticClass >> "limitNearby");
|
||||||
|
|
||||||
if (_limitNearby > 0) then{
|
if (_limitNearby > 0) then{
|
||||||
_objectCount = count nearestObjects[player, [_staticClass, _simulClass], _buildingJammerRange];
|
// remove current target from objects
|
||||||
if (_objectCount > _limitNearby) then{
|
_objectCount = count (nearestObjects[player, [_staticClass, _simulClass], _buildingJammerRange] - [_obj]);
|
||||||
|
// TODO: not properly limiting simulated objects
|
||||||
|
if (_objectCount >= _limitNearby) then{
|
||||||
_buildingAllowed = false;
|
_buildingAllowed = false;
|
||||||
[format["<t size = '1.6' color = '#99ffffff'>Building Disallowed: Limit %1</t>", _limitNearby], 5] call Epoch_dynamicText;
|
[format["<t size = '1.6' color = '#99ffffff'>Building Disallowed: Limit %1</t>", _limitNearby], 5] call Epoch_dynamicText;
|
||||||
};
|
};
|
||||||
|
@ -93,10 +93,15 @@ if (isText(_config)) then {
|
|||||||
_rejectMove = false;
|
_rejectMove = false;
|
||||||
if ((diag_tickTime - _lastCheckTime) > 10) then {
|
if ((diag_tickTime - _lastCheckTime) > 10) then {
|
||||||
_lastCheckTime = diag_tickTime;
|
_lastCheckTime = diag_tickTime;
|
||||||
_rejectMove = !(_objType call EPOCH_isBuildAllowed);
|
_rejectMove = !(EPOCH_target call EPOCH_isBuildAllowed);
|
||||||
};
|
};
|
||||||
if (_rejectMove) exitWith{
|
if (_rejectMove) exitWith{
|
||||||
EPOCH_target = objNull;
|
// remove object and refund items
|
||||||
|
deleteVehicle EPOCH_target;
|
||||||
|
_removeParts = getArray(('CfgBaseBuilding' call EPOCH_returnConfig) >> _objType >> "removeParts");
|
||||||
|
{
|
||||||
|
[_x select 0,_x select 1] call EPOCH_fnc_addItemOverflow;
|
||||||
|
} forEach _removeParts;
|
||||||
};
|
};
|
||||||
_playerdistance = player distance EPOCH_target;
|
_playerdistance = player distance EPOCH_target;
|
||||||
if (_playerdistance < 10) then {
|
if (_playerdistance < 10) then {
|
||||||
|
@ -1 +1 @@
|
|||||||
build=435;
|
build=436;
|
||||||
|
@ -1 +1 @@
|
|||||||
build=435;
|
build=436;
|
||||||
|
@ -1 +1 @@
|
|||||||
build=435;
|
build=436;
|
||||||
|
@ -1 +1 @@
|
|||||||
build=435;
|
build=436;
|
||||||
|
Loading…
Reference in New Issue
Block a user