server/addons/db/functions/fnc_loadGameState.sqf
Jacob Schmidt 257a62acc0 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.
2025-04-05 14:24:46 -05:00

33 lines
894 B
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_server_db_fnc_loadGameState
* Author: J. Schmidt
*
* Description:
* Loads game state from mission or profile namespace and sets appropriate variables
*
* Arguments:
* 0: _nameSpace - Namespace to load from (mission, profile) <STRING> (default: mission)
*
* Return Value:
* Success <BOOL>
*/
params [["_nameSpace", "mission", [""]]];
private _companyState = createHashMap;
if (_nameSpace == "mission") then {
_companyState = ["companyStore", "CompanyState"] call FUNC(loadFromMission);
} else {
_companyState = ["companyStore", "CompanyState"] call FUNC(loadFromProfile);
};
if (!isNil "_companyState") then {
companyFunds = _companyState getOrDefault ["funds", 0];
companyRating = _companyState getOrDefault ["rating", 0];
companyShareholders = _companyState getOrDefault ["operations", []];
};
true