Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropped unique item synchronisation bug #7859

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yggdrasill
Copy link

@Yggdrasill Yggdrasill commented Mar 18, 2025

Hello,

This is just a small fix-up of network synchronisation code and a use of an uninitialised variable, which is most likely only noticeable now due to the new unique item generation code introduced in #7060.

Basically, on the receiving system, dropped items temporarily morph until the save is reloaded. The reason is that RecreateItem() tries to extract uidOffset from item.dwBuff. Since item.dwBuff was never initialised in SyncDropItem() before the call to RecreateItem(), a Xorine's Ring would morph into a Ring of Thunder temporarily on my system.

The fix is simple, and simply moves initialisation of item.dwBuff to before the call. I have attached a character file with Bramble and Xorine's Ring in the inventory for you to test.

Thanks,
Yggdrasill

	This commit addresses a bug in which RecreateItem() is called
	from inv.cpp:SyncItemDrop(), and it tries to extract uidOffset
	from an uninitialised item.dwBuff. Besides being an obvious bug,
	this also caused temporary morphing for the receiving client.
@Yggdrasill
Copy link
Author

Sorry about that, I forgot to attach the file. Here's the character file:

multi_1.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant