If a player's left, the win timeout won't take longer than 60 seconds

This commit is contained in:
Guangcong Luo 2012-02-05 17:48:01 -05:00
parent 352485c276
commit 7cb61d1fc8

5
app.js
View File

@ -380,6 +380,11 @@ function Room(roomid, format, p1, p2, parentid, ranked)
{
waitTime = 30;
}
if (waitTime > 60 && (!selfR.battle.allySide.user || !selfR.battle.foeSide.user))
{
// if a player has left, don't wait longer than 60 seconds
waitTime = 60;
}
selfR.battle.add('message Inactive players will '+action+' in '+waitTime+' seconds'+attrib+'.');
selfR.update();
selfR.resetTimer = setTimeout(selfR.kickInactive, waitTime*1000);