Merge pull request #1045 from icomrade/master

Remove duplicate code + other fix
This commit is contained in:
vbawol
2014-01-31 07:08:53 -08:00

View File

@@ -412,15 +412,16 @@ if (!isDedicated) then {
_control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102;
};
waitUntil {!dayz_DisplayGenderSelect};
if (!isNil "dayz_DisplayGenderSelect") then {
waitUntil {!dayz_DisplayGenderSelect};
};
// 120 sec timeout (12000 * 0.01)
while { _timeOut < 12000 } do {
if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
if (!isNil "_display") then {
if ( isNull _display ) then {
waitUntil { !dialog; };
if ( isNull _display ) then {
waitUntil { !dialog; };
startLoadingScreen ["","RscDisplayLoadCustom"];
_display = uiNameSpace getVariable "BIS_loadingScreen";
_control1 = _display displayctrl 8400;
@@ -448,39 +449,6 @@ if (!isDedicated) then {
};
};
// TODO: need move it in player_monitor.fsm
// allow player disconnect from server, if loading hang, kicked by BE etc.
[] spawn {
private["_timeOut","_display","_control1","_control2"];
disableSerialization;
_timeOut = 0;
dayz_loadScreenMsg = "";
diag_log "DEBUG: loadscreen guard started.";
_display = uiNameSpace getVariable "BIS_loadingScreen";
_control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102;
// 120 sec timeout
while { _timeOut < 3000 && !dayz_clientPreload && !dayz_authed } do {
if ( isNull _display ) then {
waitUntil { !dialog; };
startLoadingScreen ["","RscDisplayLoadCustom"];
_display = uiNameSpace getVariable "BIS_loadingScreen";
_control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102;
};
if ( dayz_loadScreenMsg != "" ) then {
_control1 ctrlSetText dayz_loadScreenMsg;
dayz_loadScreenMsg = "";
};
_control2 ctrlSetText format["%1",round(_timeOut*0.01)];
_timeOut = _timeOut + 1;
sleep 0.01;
};
endLoadingScreen;
};
dayz_meleeMagazineCheck = {
private["_meleeNum","_magType"];
_magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;