Fix list shops cancel, run maintenance on load

This commit is contained in:
Tyler Hallada 2020-11-14 02:25:02 -05:00
parent ece73fcf0e
commit 5cf8deea30
3 changed files with 8 additions and 5 deletions

Binary file not shown.

View File

@ -1,9 +1,12 @@
Scriptname BRQuestPlayerAliasScript extends ReferenceAlias Scriptname BRQuestPlayerAliasScript extends ReferenceAlias
Quest property BRQuest auto
Cell property BREmpty auto Cell property BREmpty auto
event OnPlayerLoadGame() event OnPlayerLoadGame()
Debug.Trace("Player load game") Debug.Trace("Player load game")
BRQuestScript BRScript = BRQuest as BRQuestScript
BRScript.Maintenance()
Cell currentCell = self.GetReference().GetParentCell() Cell currentCell = self.GetReference().GetParentCell()
if currentCell == BREmpty if currentCell == BREmpty
Debug.Trace("Player's loaded cell is BREmpty, resetting merch") Debug.Trace("Player's loaded cell is BREmpty, resetting merch")

View File

@ -249,12 +249,12 @@ event OnListShopsSuccess(int[] ids, string[] names, string[] descriptions)
int index = 0 int index = 0
int selectedIndex = UILib.ShowList("Shop Merchandise", names, 0, 0) int selectedIndex = UILib.ShowList("Shop Merchandise", names, 0, 0)
ListShopsComplete = true ListShopsComplete = true
Debug.MessageBox(names[selectedIndex] + " (ID: " + ids[selectedIndex] + ")\n\n" + descriptions[selectedIndex])
ActiveShopId = ids[selectedIndex]
ActiveShopName = names[selectedIndex]
ActiveShopDescription = descriptions[selectedIndex]
ShopDetailMessage.SetName(names[selectedIndex])
if ShopDetailMessage.Show() == 0 if ShopDetailMessage.Show() == 0
Debug.MessageBox(names[selectedIndex] + " (ID: " + ids[selectedIndex] + ")\n\n" + descriptions[selectedIndex])
ActiveShopId = ids[selectedIndex]
ActiveShopName = names[selectedIndex]
ActiveShopDescription = descriptions[selectedIndex]
ShopDetailMessage.SetName(names[selectedIndex])
bool result = BRInteriorRefList.ClearCell() bool result = BRInteriorRefList.ClearCell()
if !result if !result
Debug.MessageBox("Failed to clear existing shop before loading in new shop.\n\n" + BugReportCopy) Debug.MessageBox("Failed to clear existing shop before loading in new shop.\n\n" + BugReportCopy)