Zarel/Pokemon-Showdown — pull request #904 by Pikachuun (2014-05-05 14:59:04+00:00)
Title: Fixing Gen 3 Wish

Wish would not work if a Pokemon faints. This added code essentially allows Wish to constantly check if a Pokemon faints. If it does, it heals the new Pokemon. If even that Pokemon faints [due to spikes damage], it will keep going until a Pokemon doesn't faint.