Skip to content

Commit 1356425

Browse files
authored
Update hashmap variable for sector objects
1 parent 0be7a7f commit 1356425

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Missionframework/functions/fn_registerSectorObjects.sqf

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
File: fn_registerSectorObjects.sqf
33
Author: PiG13BR - https://github.com/PiG13BR
44
Date: 2024-11-23
5-
Last Update: 2024-11-24
5+
Last Update: 2024-11-30
66
License: MIT License - http://www.opensource.org/licenses/MIT
77
88
Description:
@@ -30,9 +30,9 @@ if (!isServer) exitWith {};
3030
_allObjects append _onlyEditedObjs;
3131
}forEach KPLIB_sectors_all;
3232

33-
if (isNil "KPBLIB_garrisonsHashMap") then {
33+
if (isNil "KPBLIB_sectorObjects_hashMap") then {
3434
// Creates the hashmap
35-
KPBLIB_garrisonsHashMap = createHashMap;
35+
KPBLIB_sectorObjects_hashMap = createHashMap;
3636
};
3737

3838
{
@@ -43,14 +43,14 @@ if (!isServer) exitWith {};
4343
if (_sector isEqualTo "") then {[format ["%1 in position %2 is too far away from any sectors. Deleting the object.", (typeOf _x), (getPos _x)], "WARNING"] call KPLIB_fnc_log; deleteVehicle _x; continue};
4444

4545
// Check if the key (sector) is already in the hashmap
46-
if !(_sector in KPBLIB_garrisonsHashMap) then {
46+
if !(_sector in KPBLIB_sectorObjects_hashMap) then {
4747
// Create a new key with a value
48-
KPBLIB_garrisonsHashMap set [_sector, [[typeOf _x, [getPosATL _x, getDir _x]]]];
48+
KPBLIB_sectorObjects_hashMap set [_sector, [[typeOf _x, [getPosATL _x, getDir _x]]]];
4949
} else {
5050
// Update key values if key already exists
51-
private _mapValue = KPBLIB_garrisonsHashMap get _sector;
51+
private _mapValue = KPBLIB_sectorObjects_hashMap get _sector;
5252
private _mapNewValues = _mapValue + [[typeOf _x, [getPosATL _x, getDir _x]]];
53-
KPBLIB_garrisonsHashMap set [_sector, _mapNewValues];
53+
KPBLIB_sectorObjects_hashMap set [_sector, _mapNewValues];
5454
};
5555

5656
// Delete the object to spawn it later when the sector is activated

0 commit comments

Comments
 (0)