Fix hashmap bug in laser seeker (#8531)

* fix bug in laser

* use `hashValue`
This commit is contained in:
Brandon Danyluk 2021-10-16 12:29:57 -06:00 committed by GitHub
parent e9912a4c33
commit 2dfbaa90b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ private _finalOwner = objNull;
};
};
};
} forEach (GVAR(laserEmitters) select 2); // Go through all values in hash
} forEach (values GVAR(laserEmitters)); // Go through all values in hash
TRACE_2("",count _spots, _spots);
@ -164,8 +164,8 @@ if ((count _spots) > 0) then {
{
_x params ["_xPos", "_owner"];
_finalPos = _finalPos vectorAdd _xPos;
private _count = _ownersHash getOrDefault [_owner, 0];
_ownersHash set [_owner, _count + 1];
private _count = _ownersHash getOrDefault [hashValue _owner, 0];
_ownersHash set [hashValue _owner, _count + 1];
} forEach _finalBucket;
_finalPos = _finalPos vectorMultiply (1 / (count _finalBucket));