diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 8a8fc6b96..37469b836 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -555,7 +555,7 @@ if (isServer) then { // EPOCH ADDITIONS currentObjectUIDs = []; - keyStartNumber = 100000000000; + keyStartNumber = 10; // Can not exceed 6 digits. Numbers >= 1 million are truncated when converted to string. i.e. "1e+006" DZE_safeVehicle = ["ParachuteWest","ParachuteC"]; if (isNil "EpochUseEvents") then {EpochUseEvents = false;}; if (isNil "EpochEvents") then {EpochEvents = [];}; diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index bf2100558..290cbe2b6 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -228,6 +228,9 @@ dayz_objectUID2 = { while {true} do { if !(_key in currentObjectUIDs) exitWith {currentObjectUIDs set [count currentObjectUIDs,_key];}; keyStartNumber = keyStartNumber + 1; + if (keyStartNumber > 40000) exitWith { //Should never fail more times than total number of objects in database + diag_log format["ERROR: dayz_objectUID2 failed to correct duplicate objectUID: %1. This should not happen.",_key]; + }; _key = str keyStartNumber; diag_log format["Duplicate UID generated by dayz_objectUID2. Automatically corrected to +1= %1. This should rarely happen.",_key]; };