fix: Use EFUNC for org store verification in handlePurchase
All checks were successful
Build / Build (push) Successful in 27s

This commit fixes an issue in `fnc_handlePurchase.sqf` where the organization store was being accessed directly from the mission namespace. This has been updated to use the `EFUNC(org,verifyOrgStore)` function to ensure proper verification and access to the organization store. This change improves code maintainability and reduces the risk of errors due to incorrect store access.
This commit is contained in:
Jacob Schmidt 2025-04-05 16:57:29 -05:00
parent 8b1b5153be
commit c17e7921b3

View File

@ -36,7 +36,7 @@ if (count _payment > 3) then {
}; };
if (_payment select 0 == "Organization") then { if (_payment select 0 == "Organization") then {
private _store = missionNamespace getVariable ["FORGE_ORG_STORE_REG", createHashMap]; private _store = call EFUNC(org,verifyOrgStore);
private _org = _store call ["getOrg", []]; private _org = _store call ["getOrg", []];
private _ownerUID = _org get "owner"; private _ownerUID = _org get "owner";
@ -49,7 +49,7 @@ if (_payment select 0 == "Organization") then {
private _varType = _payment select 2; private _varType = _payment select 2;
private _balance = switch (_varType) do { private _balance = switch (_varType) do {
case "organization": { case "organization": {
private _store = missionNamespace getVariable ["FORGE_ORG_STORE_REG", createHashMap]; private _store = call EFUNC(org,verifyOrgStore);
_store call ["getFunds", []]; _store call ["getFunds", []];
}; };
case "player": { player getVariable [_payment select 1, 0] }; case "player": { player getVariable [_payment select 1, 0] };
@ -64,7 +64,7 @@ if (_balance < _price) exitWith {
switch (_varType) do { switch (_varType) do {
case "organization": { case "organization": {
private _store = missionNamespace getVariable ["FORGE_ORG_STORE_REG", createHashMap]; private _store = call EFUNC(org,verifyOrgStore);
_store call ["updateFunds", -_price]; _store call ["updateFunds", -_price];
}; };
case "player": { case "player": {