[Fix] Fix Object Name Init, User Refs, and Client Sync on Close#4861
Merged
Akkadius merged 3 commits intoEQEmu:masterfrom May 15, 2025
Merged
[Fix] Fix Object Name Init, User Refs, and Client Sync on Close#4861Akkadius merged 3 commits intoEQEmu:masterfrom
Akkadius merged 3 commits intoEQEmu:masterfrom
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Couple minor fixes to object behaviors I found when working with the object API.
Issue 1: Fix uninitialized char* in object.cpp
Objects created via the API would show trash data in their name. This change memsets the char array to zero in the constructors.
Issue 2: Clear object user and user tradeskill object on reset.
A call to Object:Delete(true) would uninitialize a lot of fields in the object but leave lingering references to the user who was using it as well as a reference back to that object from the user. This would cause a zone crash if the user continued to interact with the object. I've added a 'Close' call to the top of ResetState to clear these references.
Issue 3: Send clear object packet on Object::Close()
Calling Object:Close() would move any items in the object's inventory back into the user's inventory but not actually update the client that the object's inventory was now empty, creating the appearance that there were two items.
This change sends a ClearObject packet to the active user when close is called.
Type of change
Testing
Akk-stack with rof2 client.
Test script
Issue 1:
Before

After

Issue 2:
Before

After

Issue 3:
Original stack trace

Crash did not reproduce after fix applied.
Checklist