mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-25 16:14:01 -05:00
Fix long battle rewind (#2561)
--------- Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
This commit is contained in:
parent
83acefb0dd
commit
871fa18898
|
|
@ -1244,7 +1244,7 @@
|
|||
},
|
||||
rewindTurn: function () {
|
||||
if (this.battle.turn) {
|
||||
this.battle.seekTurn(this.battle.turn - 1);
|
||||
this.battle.seekBy(-1);
|
||||
}
|
||||
},
|
||||
goToEnd: function () {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export class BattleLog {
|
|||
const button = el.getElementsByTagName('button')[0];
|
||||
button?.addEventListener?.('click', e => {
|
||||
e.preventDefault();
|
||||
this.scene?.battle.seekTurn(this.scene.battle.turn - 100);
|
||||
this.scene?.battle.seekBy(-100);
|
||||
});
|
||||
this.addNode(el);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ export class ChatRoom extends PSRoom {
|
|||
|
||||
let turnNum = Number(target);
|
||||
if (target.startsWith('+') || turnNum < 0) {
|
||||
turnNum += this.battle.turn;
|
||||
turnNum += this.battle.seeking ?? this.battle.turn;
|
||||
if (turnNum < 0) turnNum = 0;
|
||||
} else if (target === 'end') {
|
||||
turnNum = Infinity;
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ var ReplayPanel = Panels.StaticPanel.extend({
|
|||
this.battle.skipTurn();
|
||||
},
|
||||
rewind: function() {
|
||||
this.battle.seekTurn(this.battle.turn - 1);
|
||||
this.battle.seekBy(-1);
|
||||
},
|
||||
ffto: function() {
|
||||
var turn = prompt('Turn?');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user