diff --git a/scripts/_00e_theriantrophist_alchemycontrol.pex b/scripts/_00e_theriantrophist_alchemycontrol.pex index 031ebd64..735edf6a 100644 Binary files a/scripts/_00e_theriantrophist_alchemycontrol.pex and b/scripts/_00e_theriantrophist_alchemycontrol.pex differ diff --git a/source/scripts/_00e_theriantrophist_alchemycontrol.psc b/source/scripts/_00e_theriantrophist_alchemycontrol.psc index df9cde6e..4af11dba 100644 --- a/source/scripts/_00e_theriantrophist_alchemycontrol.psc +++ b/source/scripts/_00e_theriantrophist_alchemycontrol.psc @@ -140,15 +140,10 @@ function _addNamedPotion(Potion aPotion, string sName, string sModel) endfunction -function _removeNamedPotion(Potion aPotion) - if aPotion - int i = aCreatedPotions.Find(aPotion) - if i > -1 - aCreatedPotions[i] = None - aPotionNames[i] = "" - aPotionModels[i] = "" - endif - endif +function _removeNamedPotion(int iIndex) + aCreatedPotions[iIndex] = None + aPotionNames[iIndex] = "" + aPotionModels[iIndex] = "" endfunction Function _UpdatePotion(Potion item, Int count) @@ -401,8 +396,10 @@ EndFunction Function _InitAchemyControl() - GoToState("") - + if GetState() != "" + GoToState("") + endif + ; Version update If curScriptVersion < LATEST_SCRIPT_VERSION Int oldScriptVersion = curScriptVersion @@ -463,9 +460,11 @@ Event OnPlayerLoadGame() int i = 0 while i < 128 - if aCreatedPotions[i] - if PlayerREF.GetItemCount(aCreatedPotions[i]) == 0 && _00E_SecureChest_HostChestREF.GetItemCount(aCreatedPotions[i]) == 0 - _removeNamedPotion(aCreatedPotions[i]) + if aCreatedPotions[i] ; this may be None but return true when a potion no longer exists + if aCreatedPotions[i] as String == "[Potion ]" + _removeNamedPotion(i) + elseif PlayerREF.GetItemCount(aCreatedPotions[i]) == 0 && _00E_SecureChest_HostChestREF.GetItemCount(aCreatedPotions[i]) == 0 + _removeNamedPotion(i) else aCreatedPotions[i].SetName(aPotionNames[i]) if aPotionModels[i] != ""