Quantum Potion bug

The Quantum Potion Bug is a programming mistake in the very first screen of Final Fantasy VII. The train platform for Reactor No. 1 has two unconscious Shin Ra guards from which the player can retrieve items by checking their bodies, however due to a mistake in copying the code the same items can be retrieved from either guard. That is, retrieving a potion from one guard removes it from the body of the other guard as if the potion existed in a quantum superposition of states, hence the name Quantum Potion bug.

Quantum Potions
When an item is collected from a field location or chest etc, a variable is set to record that the item has been collected to prevent the player picking up the same item repeatedly. Both guards have two potions but they share the same internal variable to keep track of if the potion(s) have been collected. Therefore any of the following combinations is possible but it is not possible to get more than two potions: - Get two potions from the lower guard's body - Get two potions from the upper guard's body - Get one potion from each guard (Lower then upper) - Get one potion from each guard (Upper then lower)

Pseudocode
The code for both guards when inspecting the body is as follows: If Var[15][32] Bit 0 is OFF {Display "Received Potion!" Add 1 potion to inventory Set Var[15][32] Bit 0 to ON} If Var[15][32] Bit 1 is OFF {Display "Received Potion!" Add 1 potion to inventory Set Var[15][32] Bit 1 to ON}

Third Guard
There is a third guard in the game code for this location that shares the same variables as the first two guards so would also be subject to this bug. However, the third guard has the field model hidden and the ability for Cloud to interact with it disabled, so the guard is invisible and cannot be spoken to to retrieve the potion(s).

Origins
It is likely that this bug originated from an incomplete copy-and-paste process of duplicating the first guard. If the original programmer had remembered to change the variables used for tracking items then this bug would not have happened. The existence of a third, invisible guard adds weight to this theory as it is another leftover copy. a The glitch remains in all versions, including PC re-release, PlayStation 4, iOS, and Android.