(Note: the actual question is in the 3rd part, sorry for the long build up)
Introduction
As you may know, an algorithm in the map Temple of the Past is bugged.
In Campaign Mission / ======= GAMEPLAY ======= / AI / Attack Waves A / Attack Wave A 20 mins
there is the following code:
------- Setup Drop Location Array Variable -Set DropLocationTotal = 4 Variable -Set DropLocations[1] = Drop Attack Location 01 Variable -Set DropLocations[2] = Drop Attack Location 02 Variable -Set DropLocations[3] = Drop Attack Location 03 Variable -Set DropLocations[4] = Drop Attack Location 04 ------- Shuffle Order General -Repeat (Actions) 3 times Actions Variable -Set DropLocationIter = (Random integer between 1 and (DropLocationTotal - 1)) ------- Comment Variable -Set DropLocationTemp = DropLocations[DropLocationTotal] Variable -Set DropLocations[DropLocationTotal] = DropLocations[DropLocationIter] Variable -Set DropLocations[DropLocationIter] = DropLocations[DropLocationTotal]
Because " DropLocationTemp" receive a value, but that value is never used, the algorithms is clearly incorrect.
But then, there may not be “one right fix”, we would have to make sure of the intent of the devs to decide.
Proposals
Thus here are 2 possibles fixes I thought of:
1.
------- Setup Drop Location Array Variable -Set DropLocationTotal = 4 Variable -Set DropLocations[1] = Drop Attack Location 01 Variable -Set DropLocations[2] = Drop Attack Location 02 Variable -Set DropLocations[3] = Drop Attack Location 03 Variable -Set DropLocations[4] = Drop Attack Location 04 ------- Shuffle Order General -Repeat (Actions) 3 times Actions Variable -Set DropLocationIter = (Random integer between 1 and (DropLocationTotal - 1)) ------- Comment Variable -Set DropLocationTemp = DropLocations[DropLocationTotal] Variable -Set DropLocations[DropLocationTotal] = DropLocations[DropLocationIter] Variable -Set DropLocations[DropLocationIter] = DropLocations[DropLocationTemp]
This code swap around the locations, seems the most logical fix.
Features:
- The north-west of the temple is now a valid drop location
- Each drop location is used exactly once
2.
------- Setup Drop Location Array Variable -Set DropLocationTotal = 4 Variable -Set DropLocations[1] = Drop Attack Location 01 Variable -Set DropLocations[2] = Drop Attack Location 02 Variable -Set DropLocations[3] = Drop Attack Location 03 Variable -Set DropLocations[4] = Drop Attack Location 04 ------- Shuffle Order General -Repeat (Actions) 3 times Actions Variable -Set DropLocations[(Random integer between 1 and (DropLocationTotal))] = DropLocations[(Random integer between 1 and (DropLocationTotal))]
This code preserve the ability for a drop location to be overwritten like the original.
Features:
- The north-west of the temple is now a valid drop location
- A drop location may be used once, multiple times, or not at all
Questions
- Which fix do you prefer?
- Which fix do you think correspond to what Blizzard wanted to do? (If neither, what are you thinking of?)