Fix renamed equipped-model entities rendering their name as gear - #10903
Fix renamed equipped-model entities rendering their name as gear#10903DriftwoodGaming wants to merge 1 commit into
Conversation
A MODEL_EQUIPPED look_t is memcpy'd into the 0x00E packet at 0x30 and is 20 bytes, so it spans 0x30-0x43. The renamed-entity branch below it then writes the name at 0x34, overwriting head/body/hands/legs/feet/main/sub/ranged. Usually invisible, because a routine update's flag byte has no UPDATE_LOOK and the client ignores those bytes. But CCharEntity::updateEntityPacket merges a later update into a still-queued packet for the same entity and ORs the flag byte, so an update merged into an unflushed spawn keeps UPDATE_LOOK set and the client renders the name text as gear model ids. An entity named "Tea" spawns wearing head = 'T','e', body = 'a',0 and nothing from main onward, so it also loses its weapon model. The spawn path already solves this with the larger 0x56 layout and the name at 0x44. Skip the redundant per-update re-send for exactly those entities. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
✨ Hello and thanks for the PR! ✨ 🤖: This is a friendly automated reminder that the maintainers won't look at your PR until you've properly completed all of the checkboxes in the pre-filled template. |
|
Do you have a capture so we can check the packets? |
|
I haven't tested on retail, Nobutadas but you can //pv track incoming 0x00E if you have an account active. |
|
I see you've restored the template, thanks. I have no doubt the entity packet is broken in certain cases (and in fact what you're going through is a very well known pitfall that has caused many bugs) but can you tell me which retail content requires renaming dynamic entities? There's work underway to rewrite this packet entirely and I am not interested in adding more hacks unless they are provably blocking implementation of retail content. |
|
It may not be needed on retail-era servers, this is a bug I found while updating a private customized rework of the game. |
Burden is on you to provide proof. If we had to go and do caps and full verification on every single PR that came in, we'd get nothing done. |
|
No worries, that's fair. |
I affirm:
What does this pull request do?
Stops a renamed trust/fellow-style entity from having its name written over its gear models in the 0x00E packet.
In
updateWith, the spawn branch copies aMODEL_EQUIPPEDlook_tto 0x30. That look is 20 bytes, so it covers 0x30-0x43. The renamed branch underneath then writes the name at 0x34, which lands on top of head, body, hands, legs, feet, main, sub and ranged.Most of the time you never see it, because a normal update doesn't set
UPDATE_LOOKand the client ignores those bytes. It shows up whenCCharEntity::updateEntityPacketmerges a later update into a spawn packet that hasn't been flushed yet — the flag byte gets OR'd,UPDATE_LOOKis still set from the spawn, and the client reads the name text as gear model ids. A trust named "Tea" spawns with head = 'T','e', body = 'a',0 and nothing from main onward, so it also shows up with no weapon.The spawn branch already handles these entities with the 0x56 layout that puts the name at 0x44, so they've got their name from the spawn packet and don't need the name re-sent on every update. This skips that re-send for exactly that case.
Steps to test these changes
renameEntityaMODEL_EQUIPPEDentity with targid >= 0x700 — a trust is the easiest one to reach.