商品補充時の挙動修正

This commit is contained in:
kimura 2021-11-11 17:18:31 +09:00
parent f3c53911b5
commit d52f78a6df
1 changed files with 5 additions and 7 deletions

View File

@ -484,18 +484,16 @@ public class Market : SingletonMonoBehaviour<Market>
shuffledOrder.AddRange(refillList); shuffledOrder.AddRange(refillList);
try try
{ {
if (displayFlavors.Count <= shopStock.Count) var diffDisplayCount = shopStock.Count - displayFlavors.Count;
if (diffDisplayCount > 0)
{ {
displayFlavors = shopStock.ToList(); displayFlavors.AddRange(shopStock.GetRange(displayFlavors.Count, diffDisplayCount));
} }
else
{
for (int i = 0; i < refillList.Count; i++) for (int i = 0; i < refillList.Count; i++)
{ {
displayFlavors[refillList[i]] = shopStock[shopStock.Count - 1 - i]; displayFlavors[refillList[i]] = shopStock[shopStock.Count - 1 - i];
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
throw; throw;