mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Fix a few stylistic errors
This commit is contained in:
parent
5632106272
commit
01b5884691
|
|
@ -2006,7 +2006,6 @@ var Battle = (function() {
|
|||
this.win();
|
||||
};
|
||||
Battle.prototype.win = function(side) {
|
||||
var winSide = false;
|
||||
if (this.ended) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3296,6 +3295,12 @@ var Battle = (function() {
|
|||
Battle.prototype.leave = function(slot) {
|
||||
if (slot === 'p1' || slot === 'p2') {
|
||||
var side = this[slot];
|
||||
if (!side) {
|
||||
console.log('**** '+slot+' tried to leave before it was possible in '+this.id);
|
||||
require('./crashlogger.js')({stack: '**** '+slot+' tried to leave before it was possible in '+this.id}, 'A simulator process');
|
||||
return;
|
||||
}
|
||||
|
||||
side.emitUpdate({side:'none'});
|
||||
side.isActive = false;
|
||||
this.add('player', slot);
|
||||
|
|
|
|||
2
rooms.js
2
rooms.js
|
|
@ -938,7 +938,7 @@ var BattleRoom = (function() {
|
|||
}
|
||||
return user;
|
||||
};
|
||||
GlobalRoom.prototype.onUpdateIdentity = function() {};
|
||||
BattleRoom.prototype.onUpdateIdentity = function() {};
|
||||
BattleRoom.prototype.onLeave = function(user) {
|
||||
if (!user) return; // ...
|
||||
if (user.battles[this.id]) {
|
||||
|
|
|
|||
5
users.js
5
users.js
|
|
@ -1042,10 +1042,11 @@ exports.checkBanned = checkBanned;
|
|||
exports.checkLocked = checkLocked;
|
||||
|
||||
function unban(name) {
|
||||
var success;
|
||||
var userid = toId(name);
|
||||
for (var ip in bannedIps) {
|
||||
if (Users.bannedIps[ip] === userid) {
|
||||
delete Users.bannedIps[ip];
|
||||
if (bannedIps[ip] === userid) {
|
||||
delete bannedIps[ip];
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user