fix: only show fishing message for player's own bobber, not others'
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

SMSG_GAMEOBJECT_CUSTOM_ANIM with animId=0 on a fishing node (type 17)
was triggering "A fish is on your line!" for ALL fishing bobbers in
range, including other players'. Now checks OBJECT_FIELD_CREATED_BY
(fields 6-7) matches the local player GUID before showing the message.
This commit is contained in:
Kelsi 2026-03-28 10:35:53 -07:00
parent b8a9efb721
commit 1bcb05aac4

View file

@ -2195,11 +2195,17 @@ void GameHandler::registerOpcodeHandlers() {
auto goEnt = entityManager.getEntity(guid);
if (goEnt && goEnt->getType() == ObjectType::GAMEOBJECT) {
auto go = std::static_pointer_cast<GameObject>(goEnt);
auto* info = getCachedGameObjectInfo(go->getEntry());
if (info && info->type == 17) {
addUIError("A fish is on your line!");
addSystemChatMessage("A fish is on your line!");
withSoundManager(&rendering::Renderer::getUiSoundManager, [](auto* sfx) { sfx->playQuestUpdate(); });
// Only show fishing message if the bobber belongs to us
// OBJECT_FIELD_CREATED_BY is a uint64 at field indices 6-7
uint64_t createdBy = static_cast<uint64_t>(go->getField(6))
| (static_cast<uint64_t>(go->getField(7)) << 32);
if (createdBy == playerGuid) {
auto* info = getCachedGameObjectInfo(go->getEntry());
if (info && info->type == 17) {
addUIError("A fish is on your line!");
addSystemChatMessage("A fish is on your line!");
withSoundManager(&rendering::Renderer::getUiSoundManager, [](auto* sfx) { sfx->playQuestUpdate(); });
}
}
}
}