mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Prevent queuing multiple vehicle upgrades
This commit is contained in:
@@ -125,11 +125,15 @@ if (_IsNearVehicle >= 1) then {
|
||||
// Current charID
|
||||
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
|
||||
|
||||
[_newclassname,objNull] call fn_waitForObject;
|
||||
dze_waiting = nil;
|
||||
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,true,_objectCharacterID,player];
|
||||
publicVariableServer "PVDZE_veh_Upgrade";
|
||||
publicVariableServer "PVDZE_veh_Upgrade";
|
||||
|
||||
localize "STR_EPOCH_VEHUP_SUCCESS" call dayz_rollingMessages;
|
||||
{player reveal _x;} count (player nearEntities [["LandVehicle"],10]);
|
||||
|
||||
//Wait for hive to finish spawning vehicle. Prevents dupe via player queuing multiple upgrades.
|
||||
waitUntil {!isNil "dze_waiting"};
|
||||
};
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -11,7 +11,11 @@ _activatingPlayer = _this select 5;
|
||||
_characterID = _keySelected;
|
||||
|
||||
_isOK = isClass(configFile >> "CfgVehicles" >> _class);
|
||||
if(!_isOK || isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); };
|
||||
if (!_isOK || isNull _object) exitWith {
|
||||
diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class));
|
||||
dze_waiting = "fail";
|
||||
(owner _activatingPlayer) publicVariableClient "dze_waiting";
|
||||
};
|
||||
|
||||
#ifdef OBJECT_DEBUG
|
||||
diag_log ("PUBLISH: Attempt " + str(_object));
|
||||
@@ -75,7 +79,11 @@ _key call server_hiveWrite;
|
||||
};
|
||||
};
|
||||
|
||||
if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); };
|
||||
if (!_done) exitWith {
|
||||
diag_log("CUSTOM: failed to get id for : " + str(_uid));
|
||||
dze_waiting = "fail";
|
||||
(owner _activatingPlayer) publicVariableClient "dze_waiting";
|
||||
};
|
||||
|
||||
// add items from previous vehicle here
|
||||
_weapons = getWeaponCargo _object;
|
||||
@@ -142,5 +150,8 @@ _key call server_hiveWrite;
|
||||
PVDZE_veh_Init = _object;
|
||||
publicVariable "PVDZE_veh_Init";
|
||||
|
||||
dze_waiting = "success";
|
||||
(owner _activatingPlayer) publicVariableClient "dze_waiting";
|
||||
|
||||
diag_log ("PUBLISH: " + str(_activatingPlayer) + " Upgraded " + (_class) + " with ID " + str(_uid));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user