fix: Rename companyGenerals
to companyShareholders
This commit renames the `companyGenerals` variable to `companyShareholders` to better reflect its intended purpose and usage within the codebase. The change affects the following files: - `addons/main/config.cpp`: Renames the `companyGenerals` config entry to `companyShareholders`. - `addons/init/functions/fnc_handleServerState.sqf`: Updates the variable name used when saving company state. - `addons/db/functions/fnc_loadGameState.sqf`: Updates the variable name used when loading company state. - `addons/db/functions/fnc_saveGameState.sqf`: Updates the variable name used when saving company state. - `addons/init/functions/fnc_handleServerStateLoad.sqf`: Updates the variable name used when loading company state from the server. This change ensures consistency and clarity in the codebase, making it easier to understand and maintain. The `companyGarageUnlocks` variable was also removed from the save/load functions as it was not being used.
This commit is contained in:
parent
5b30efa3b0
commit
257a62acc0
@ -27,8 +27,7 @@ if (_nameSpace == "mission") then {
|
||||
if (!isNil "_companyState") then {
|
||||
companyFunds = _companyState getOrDefault ["funds", 0];
|
||||
companyRating = _companyState getOrDefault ["rating", 0];
|
||||
companyGenerals = _companyState getOrDefault ["operations", []];
|
||||
companyGarageUnlocks = _companyState getOrDefault ["garage_unlocks", []];
|
||||
companyShareholders = _companyState getOrDefault ["operations", []];
|
||||
};
|
||||
|
||||
true
|
@ -18,18 +18,14 @@ params [["_nameSpace", "mission", [""]]];
|
||||
|
||||
if (isNil "companyFunds") then { companyFunds = 0 };
|
||||
if (isNil "companyRating") then { companyRating = 0 };
|
||||
if (isNil "companyGenerals") then { companyGenerals = [] };
|
||||
if (isNil "companyShareholders") then { companyShareholders = [] };
|
||||
if (isNil "companyGarageUnlocks") then { companyGarageUnlocks = [] };
|
||||
|
||||
private _default_armory_unlocks = [[],[],[],[]];
|
||||
private _default_garage_unlocks = [[],[],[],[],[],[]];
|
||||
|
||||
private _companyState = createHashMapFromArray [
|
||||
["key", "CompanyState"],
|
||||
["funds", companyFunds],
|
||||
["rating", companyRating],
|
||||
["operations", companyGenerals],
|
||||
["garage_unlocks", companyGarageUnlocks]
|
||||
["operations", companyShareholders]
|
||||
];
|
||||
|
||||
if (_nameSpace == "mission") then {
|
||||
|
@ -8,7 +8,7 @@ switch (_condition) do {
|
||||
"CompanyState",
|
||||
"funds", [companyFunds],
|
||||
"rating", [companyRating],
|
||||
"operations", [companyGenerals],
|
||||
"operations", [companyShareholders],
|
||||
"garage_unlocks", [companyGarageUnlocks]
|
||||
];
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
_data = _this;
|
||||
|
||||
if (_data isEqualTo [""]) then {
|
||||
companyGenerals = (configFile >> "CfgPatches" >> "forge_server_main" >> "companyGenerals") call BFUNC(getCfgData);
|
||||
publicVariable "companyGenerals";
|
||||
companyShareholders = (configFile >> "CfgPatches" >> "forge_server_main" >> "companyShareholders") call BFUNC(getCfgData);
|
||||
publicVariable "companyShareholders";
|
||||
|
||||
companyFunds = "OP_BUDGET" call BFUNC(getParamValue);
|
||||
publicVariable "companyFunds";
|
||||
@ -12,9 +12,6 @@ if (_data isEqualTo [""]) then {
|
||||
companyRating = "OP_RATING" call BFUNC(getParamValue);
|
||||
publicVariable "companyRating";
|
||||
|
||||
companyGarageUnlocks = [[],[],[],[],[],[]];
|
||||
publicVariable "companyGarageUnlocks";
|
||||
|
||||
diag_log "No Server Entry Found!";
|
||||
["save"] call FUNC(handleServerState);
|
||||
|
||||
@ -32,8 +29,7 @@ if (_data isEqualTo [""]) then {
|
||||
switch (_key) do {
|
||||
case "funds": { companyFunds = _value; publicVariable "companyFunds" };
|
||||
case "rating": { companyRating = _value; publicVariable "companyRating" };
|
||||
case "operations": { companyGenerals = _value; publicVariable "companyGenerals" };
|
||||
case "garage_unlocks": { companyGarageUnlocks = _value; publicVariable "companyGarageUnlocks" };
|
||||
case "operations": { companyShareholders = _value; publicVariable "companyShareholders" };
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ class CfgPatches {
|
||||
|
||||
serverSaveLoop = 0;
|
||||
serverSaveLoopTime = 30;
|
||||
companyGenerals[] = {"76561198027566824"};
|
||||
companyShareholders[] = {"76561198027566824"};
|
||||
AISkill = 0.8;
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user