mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-04 04:03:52 +00:00
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
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:
parent
b8a9efb721
commit
1bcb05aac4
1 changed files with 11 additions and 5 deletions
|
|
@ -2195,6 +2195,11 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
auto goEnt = entityManager.getEntity(guid);
|
||||
if (goEnt && goEnt->getType() == ObjectType::GAMEOBJECT) {
|
||||
auto go = std::static_pointer_cast<GameObject>(goEnt);
|
||||
// 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!");
|
||||
|
|
@ -2203,6 +2208,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Item refund / socket gems / item time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue