Skip to content

Commit

Permalink
Fixed bugs related to moves that cause switching.
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyjf committed Oct 17, 2010
1 parent 15a4eaf commit a641866
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions resources/moves.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function makeSacrificeMove(move, func) {
return;
}
user.faint();
var slot = user.position;
user.switchOut();
field.sendMessage("informReplacePokemon", user);
var slot = user.position;
user.switchOut(); // note: sets user.position to -1.
selection.sendOut(slot);
if (!selection.fainted) {
func(field, selection);
Expand Down Expand Up @@ -231,9 +231,9 @@ function makeRandomSwitchMove(move) {
return;
}
var choice = choices[field.random(0, length - 1)];
field.sendMessage("informReplacePokemon", target);
var slot = target.position;
target.switchOut(); // note: sets target.position to -1.
field.sendMessage("informReplacePokemon", target);
choice.sendOut(slot);
};
}
Expand Down
2 changes: 1 addition & 1 deletion resources/moves.xml
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ this.effects_.forEach(function(i) {
field.narration = true;
}
});
field.sendMessage("informBatonPass", user);
var slot = user.position;
user.switchOut();
field.sendMessage("informBatonPass", user);
selection.sendOut(slot);
]]>
</use>
Expand Down

0 comments on commit a641866

Please sign in to comment.