Skip to content

Commit

Permalink
Fixed a bug with trainers being set incorrectly for caught Pokémon
Browse files Browse the repository at this point in the history
Their OT was being set to the wild, rather than the actual trainer.
  • Loading branch information
varkor committed Dec 26, 2015
1 parent 9a4e1c4 commit a3a39d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions battle/scripts/objects/general/pokemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,16 +678,16 @@ function pokemon (data, validate) {
};

self.belong = function (who) {
if (self.trainer)
self.trainer.release(self);
if (!self.caught) {
if (self.caught === null || self.isWild()) {
self.caught = {
ball : null,
location : null,
level : self.level,
trainer : who.identification
};
}
if (self.trainer)
self.trainer.release(self);
self.trainer = who;
};

Expand Down

0 comments on commit a3a39d0

Please sign in to comment.