mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 23:32:02 -05:00
Allow the server to update psuedo weather backwards compatibly (#828)
This commit is contained in:
@@ -2288,6 +2288,7 @@ var Battle = (function () {
|
||||
// has playback gotten to the point where a player has won or tied?
|
||||
// affects whether BGM is playing
|
||||
this.ended = false;
|
||||
this.usesUpkeep = false;
|
||||
this.weather = '';
|
||||
this.pseudoWeather = [];
|
||||
this.weatherTimeLeft = 0;
|
||||
@@ -2838,7 +2839,7 @@ var Battle = (function () {
|
||||
if (turnnum == this.turn + 1) {
|
||||
this.endLastTurnPending = true;
|
||||
}
|
||||
if (this.turn) this.updatePseudoWeatherLeft();
|
||||
if (this.turn && !this.usesUpkeep) this.updatePseudoWeatherLeft(); // for compatibility with old replays
|
||||
this.turn = turnnum;
|
||||
|
||||
if (this.mySide.active[0]) this.mySide.active[0].clearTurnstatuses();
|
||||
@@ -6169,6 +6170,10 @@ var Battle = (function () {
|
||||
if (this.waitForResult()) return;
|
||||
this.start();
|
||||
break;
|
||||
case 'upkeep':
|
||||
this.usesUpkeep = true;
|
||||
this.updatePseudoWeatherLeft();
|
||||
break;
|
||||
case 'turn':
|
||||
if (this.endPrevAction()) return;
|
||||
this.setTurn(args[1]);
|
||||
|
||||
Reference in New Issue
Block a user