Client Systems & Python UI
Metin2 compare item tooltip: safe item lookup and stale tooltip fix
M2City Client · Editorial · Published 2026-11-05 · Branch-specific details should be checked against your own source.
The supplied comparison module dereferences pItemData without confirming that GetItemDataPointer succeeded. An unknown item can therefore reach an invalid pointer. M2City r1 initializes the pointer and returns the unsupported result when lookup fails. The instructions now place the GetCompareIndex binding before the Python method-table NULL terminator. The Python comparison also hides and clears the previous tooltip when the new item has no comparison slot or that equipment slot is empty.
Integration for private-server developers
Back up UserInterface and root. Merge the supplied instruction fragments into the existing files; they are not complete replacement source files. Enable __COMPARE_TOOLTIP__ consistently and expose its Python constant. Check this fork's equipment/costume/belt/pendant constants and slot numbering before compiling with C++11 or newer. Keep the existing tooltip lifecycle and translate the supplied Equipped label through your locale.
ALT is checked when SetInventoryItem runs. This patch does not implement live key-toggle refresh. In a disposable client, test unsupported items, empty equipment, bonuses, stones, costumes, inventory, shops, exchange, safebox and mall. Check window positioning and cleanup when switching items.
Validation and contents
All five nonempty source/instruction files were reviewed. The actual revised native lookup passed isolated clang++ C++11 checks for an unknown item, weapon, invalid arguments and unsupported type. The revised Python method passed fake-UI tests for creation, unsupported-item cleanup, empty-slot cleanup and recreation. These are stub tests, not a client build or in-game test. The ZIP includes the corrected instructions, test sources, review notes and the unchanged original archive for comparison/rollback.
Creator reference
The supplied README credits blackdragonx61 and links to the original demonstration. That video illustrates the original feature, not a test of the M2City patch. The public release discussion is a contextual reference; an identical upstream archive hash was not established.
Editorial resource — M2City
Version: Legacy UserInterface/root fragments; __COMPARE_TOOLTIP__; exact fork unspecified; M2City r1 (2026-11-04)
Rights: Public redistribution confirmed by supplying owner; original creator notices retained. No blanket open-source licence granted.
Validation: Full supplied small-package source review and isolated native regression tests; no complete client/server build or in-game runtime validation.
Source: Compare Item Tooltip release discussion; supplied README credits blackdragonx61
SHA-256: ccbf58d50179790b1a7e8209f379a90240d4e6e3df8d2f415d41a410a469652c
Download package
3 download options · Sign in to download
metin2-compare-item-tooltip-m2city-r1.zipM2City downloadmetin2-compare-item-tooltip-m2city-r1.zipGoogle Drive mirrormetin2-compare-item-tooltip-m2city-r1.zipMEGA mirrorMAKE THE NEXT ANSWER BETTER
What happened on your build?
Share a small example, the exact error and how you verified your fix. The discussion is open on the forum.
Need a scoped quest, UI or proto fix? · Explore more development guides · Check your proto files free