Skip to content

Commit

Permalink
Fix insane mission loading time on dedicated server when first client…
Browse files Browse the repository at this point in the history
… starts mission
  • Loading branch information
Sparker95 committed Feb 13, 2021
1 parent 2ea0ec3 commit c5431ca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Templates/fn_classNameToNumber.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ private _num = t_classnames_hashmap getVariable [_className, -1];
// If it's not added yet, then add it to the hashmap
if (_num == -1) then {
_num = t_classnames_array pushBack _className;
publicVariable "t_classnames_array";
t_classnames_hashmap setVariable [_className, _num, true];
// diag_log format ["[Template::classNameToNumber] Added class name: %1, id: %2", _className, _num];
};
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/fn_convertTemplateClassNamesToNumbers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ params ["_t"];
private _classArray = _x;
{ // forEach (_classArray);
private _classOrLoadout = _x;
[_classOrLoadout] call t_fnc_classNameToNumber;
[_classOrLoadout] call t_fnc_classNameToNumber; // Later we publicVariable "t_classnames_array";
} forEach (_classArray select { _x isEqualType "" }); // Weighted array can have numbers in it
} forEach (_t#_catID);
} forEach [[T_INF, T_INF_SIZE], [T_VEH, T_VEH_SIZE], [T_DRONE, T_DRONE_SIZE], [T_CARGO, T_CARGO_SIZE]];
1 change: 1 addition & 0 deletions src/Templates/initVariables.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ if (IS_SERVER) then {
#ifndef _SQF_VM
publicVariable "t_validTemplates";
publicVariable "t_allTemplates";
publicVariable "t_classnames_array";
#endif
};

0 comments on commit c5431ca

Please sign in to comment.