_00E_Theriantrophist_AlchemyControl: when we are out of slots, forget items player does not have

This commit is contained in:
Eddoursul 2022-08-04 22:52:02 +02:00
parent 8a6ba329d9
commit 9e088bb673
4 changed files with 17 additions and 6 deletions

View File

@ -110,16 +110,28 @@ function _addNamedPotion(Potion aPotion, string sName, string sModel)
int i = aCreatedPotions.Find(aPotion)
if i == -1
if i >= 0
aPotionNames[i] = sName
aPotionModels[i] = sModel
else
i = aCreatedPotions.Find(none)
if i > -1
if i >= 0
aCreatedPotions[i] = aPotion
aPotionNames[i] = sName
aPotionModels[i] = sModel
else
; No more slots left, let's forget what we do not have in our inventory
int n = 0
while n < 128
if PlayerREF.GetItemCount(aCreatedPotions[n]) == 0
aCreatedPotions[n] = aPotion
aPotionNames[n] = sName
aPotionModels[n] = sModel
return
endif
n += 1
endwhile
endif
else
aPotionNames[i] = sName
aPotionModels[i] = sModel
endif
endfunction

View File

@ -1,5 +1,4 @@
scriptname _00E_Theriantrophist_Update_12 Hidden
{Moved to a separate script to remove the JContainers dependency from _00E_Theriantrophist_AlchemyControl}
function Run(_00E_Theriantrophist_AlchemyControl PlayerAlias) global