Stopped the Join button in the lobby from always being disabled.

The problem was that the server was sending the open game slots as a
string of the form "#/#", which lobby_data.cpp then tried to convert
to an int with: game["slots"].to_int()). The result of that was
obviously always zero.

I made the "slots" string to be written as only the number of open
slots, instead of using the form 'X slots'/'Y total'. Change it if you
like, but now everything seems to work as intended.
This commit is contained in:
Gabriel Morin 2010-08-16 20:30:07 +00:00
parent 2beda7d0f1
commit cf8a22fd2b

View File

@ -511,7 +511,7 @@ bool game::describe_slots() {
}
}
char buf[50];
snprintf(buf,sizeof(buf), "%d/%d", available_slots, num_sides);
snprintf(buf,sizeof(buf), "%d", available_slots);
if ((*description_)["slots"] != buf) {
description_->set_attr_dup("slots", buf);