From f490d450013e41f44afa6a6f3832ac187df327e3 Mon Sep 17 00:00:00 2001 From: smthspec Date: Sat, 20 Jun 2026 00:19:19 +0300 Subject: [PATCH] Fix manager: string has no HashCode(); key cooldown map by UID string GetPlainId() returns a string and string has no HashCode() in Enforce. Key the per-player proximity cooldown map by the UID string directly (map) instead of an int hash. Verified the rest of the mod's engine calls against P:\scripts (CreateObject/GetPlayerList/CallLater/RandomIntInclusive/etc.). Co-Authored-By: Claude Opus 4.8 --- scripts/4_World/YALootBoxes_Manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/4_World/YALootBoxes_Manager.c b/scripts/4_World/YALootBoxes_Manager.c index bad29bc..590c16e 100644 --- a/scripts/4_World/YALootBoxes_Manager.c +++ b/scripts/4_World/YALootBoxes_Manager.c @@ -18,13 +18,13 @@ class YALootBoxesManager { protected ref array m_ActiveBoxes; protected ref array m_FreeLocationNames; // locations currently unused (the live pool) - protected ref map m_PlayerMessageCooldown; // playerId -> last message world time + protected ref map m_PlayerMessageCooldown; // player UID -> last message world time void YALootBoxesManager() { m_ActiveBoxes = new array(); m_FreeLocationNames = new array(); - m_PlayerMessageCooldown = new map(); + m_PlayerMessageCooldown = new map(); } void Init() @@ -192,7 +192,7 @@ class YALootBoxesManager if (!nearest) continue; // Light cooldown per player so we're not spamming every 1.5s - int playerId = player.GetIdentity().GetPlainId().HashCode(); + string playerId = player.GetIdentity().GetPlainId(); float lastShown = 0; m_PlayerMessageCooldown.Find(playerId, lastShown); if (now - lastShown < 4.0) continue;