- marked as minor
Potions/Food Mixup
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)
-
reporter -
reporter - edited description
- changed title to Potions/Food Mixup
-
reporter - edited description
-
repo owner Have you noticed this anymore, after your potion rework?
-
reporter No I have not. I'll do more extensive testing today to see if I can get it to happen again.
-
reporter I have not encountered this in all my testing today.
As an aside, in your
Mystery_Potion.use()
, you haveMyBase.setName(realName)
. I've noticed that this effects bothGame.player.potions
andGame.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?
-
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.
-
reporter - changed status to resolved
Resolved in Pull Request #11
- Log in to comment