From 0d728e66b7bde350a6e5d9f0a467bba7a3433f16 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Mon, 29 Oct 2018 19:57:02 -0700 Subject: should be working --- Source/RandomizerCore.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'Source/RandomizerCore.cpp') diff --git a/Source/RandomizerCore.cpp b/Source/RandomizerCore.cpp index c673e2d..77977c6 100644 --- a/Source/RandomizerCore.cpp +++ b/Source/RandomizerCore.cpp @@ -30,9 +30,6 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) { if (flags & SWAP_AUDIO_NAMES) { offsets[AUDIO_LOG_NAME] = sizeof(void*); } - if (flags & SWAP_BACK_DISTANCE) { - offsets[EXTRA_BACK_DISTANCE] = sizeof(float); - } if (flags & SWAP_LINES) { offsets[PATH_COLOR] = 16; offsets[REFLECTION_PATH_COLOR] = 16; @@ -99,18 +96,20 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) { } } -void RandomizerCore::ReassignTargets(const std::vector& panels, const std::vector& order) { - // This list is offset by 1, so the target of the Nth panel is in position N (aka the N+1th element) - // The first panel may not have a wire to power it, so we use the panel ID itself. - std::vector targetToActivatePanel = {panels[0] + 1}; - for (const int panel : panels) { - int target = ReadPanelData(panel, TARGET, 1)[0]; - targetToActivatePanel.push_back(target); +void RandomizerCore::ReassignTargets(const std::vector& panels, const std::vector& order, std::vector targets) { + if (targets.empty()) { + // This list is offset by 1, so the target of the Nth panel is in position N (aka the N+1th element) + // The first panel may not have a wire to power it, so we use the panel ID itself. + targets = {panels[0] + 1}; + for (const int panel : panels) { + int target = ReadPanelData(panel, TARGET, 1)[0]; + targets.push_back(target); + } } for (size_t i=0; i(panels[order[i]], TARGET, {panelTarget}); } } -- cgit 1.4.1