Potions/Food Mixup

Issue #13 resolved
Houdini111 created an issue

I've seen potions made into food, most commonly red_potions as apples (the name in the inventory is red_potion, but the description and effect are that of apples). So either the potion is sometimes food, or the food is sometimes using a potion name. This has also happened with the murky_potion and chicken legs.

Comments (8)

  1. Houdini111 reporter

    No I have not. I'll do more extensive testing today to see if I can get it to happen again.

  2. Houdini111 reporter

    I have not encountered this in all my testing today.

    As an aside, in your Mystery_Potion.use(), you have MyBase.setName(realName). I've noticed that this effects both Game.player.potions and Game.Potions. This would be extraordinarily useful for the loading (both faster and cleaner). However, when I try to make it into a function:

    Sub setBaseName(ByVal s As String)
         MyBase.setName(s)
    End Sub
    

    It does not change both. Do you have any idea why this is the case or how to implement it elsewhere?

  3. V H. U repo owner

    The ByVal in your parameter should be ByRef. This affects whether the object passed is a reference to an object somewhere else (ByRef) or a disjoint clone (ByVal). Using = to set an array or list to another just makes both variables point to the same list, hence the overlap. array1 = array2.clone() sets array1 to be a separate version of the same values in array2.

  4. Log in to comment