Suprcode / Zircon

Legend of Mir 3 - Official Public Zircon Source
337 stars 256 forks source link

NPCDialog Index bug #156

Closed josh-74 closed 3 weeks ago

josh-74 commented 1 month ago

image Not my image but shows the error where the Dialogue is displaying health potions as currency.

In NPCDialog.cs

    public void OnCurrencyChanged(CurrencyInfo oValue, CurrencyInfo nValue)
    {
        if (Currency == null || Currency.DropItem == null)
        {
            CurrencyIcon.LibraryFile = LibraryFile.Inventory;
            CurrencyIcon.Index = 121;
        }
        /* else
           {
               CurrencyIcon.LibraryFile = LibraryFile.Ground;
               CurrencyIcon.Index = Currency.DropItem.Image;
           }*/

        UpdateCosts();

        CurrencyChanged?.Invoke(this, EventArgs.Empty);
    }

removing the else statement from the method fixes the issue, not too entirely sure why it switches to the else statement automatically, or if this was left here for a reason... but thought i'd jump on it.

After removing else statement:

image

Suprcode commented 1 month ago

You need to set the image number correctly in the item db and currency db for gold