Commit 30e8d494 authored by mercury233's avatar mercury233

fix

parent 29ca510e
......@@ -45,7 +45,7 @@ class Room
@find_or_create_random: (type, player_name)->
result = _.find @all, (room)->
(type == '' or room.random_type == type) and room.get_playing_player().length == 1 and room.get_playing_player()[0].name != Room.players_oppentlist[player_name]
room.random_type != '' and (type == '' or room.random_type == type) and room.get_playing_player().length == 1 and room.get_playing_player()[0].name != Room.players_oppentlist[player_name]
if result
result.welcome = '对手已经在等你了,开始决斗吧!'
#log.info 'found room', player_name
......
......@@ -58,7 +58,7 @@
Room.find_or_create_random = function(type, player_name) {
var name, result;
result = _.find(this.all, function(room) {
return (type === '' || room.random_type === type) && room.get_playing_player().length === 1 && room.get_playing_player()[0].name !== Room.players_oppentlist[player_name];
return room.random_type !== '' && (type === '' || room.random_type === type) && room.get_playing_player().length === 1 && room.get_playing_player()[0].name !== Room.players_oppentlist[player_name];
});
if (result) {
result.welcome = '对手已经在等你了,开始决斗吧!';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment