Skip to content

Fix dropped unique item synchronisation bug#7859

Closed
Yggdrasill wants to merge 1 commit intodiasurgical:masterfrom
Yggdrasill:dev
Closed

Fix dropped unique item synchronisation bug#7859
Yggdrasill wants to merge 1 commit intodiasurgical:masterfrom
Yggdrasill:dev

Conversation

@Yggdrasill
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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