mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 22:03:25 +00:00
simplyfy conditional structure
This commit is contained in:
parent
54e27d2d3f
commit
ea2386a8a7
@ -251,18 +251,16 @@ void connect_engine::import_user(const config& data, const bool observer,
|
||||
}
|
||||
}
|
||||
|
||||
if (side_taken < 0) {
|
||||
// If no sides were assigned for a user,
|
||||
// take a first available side.
|
||||
if (!side_assigned) {
|
||||
BOOST_FOREACH(side_engine_ptr side, side_engines_) {
|
||||
if (side->available_for_user(username) ||
|
||||
side->controller() == CNTR_LOCAL) {
|
||||
// If no sides were assigned for a user,
|
||||
// take a first available side.
|
||||
if (side_taken < 0 && !side_assigned) {
|
||||
BOOST_FOREACH(side_engine_ptr side, side_engines_) {
|
||||
if (side->available_for_user(username) ||
|
||||
side->controller() == CNTR_LOCAL) {
|
||||
side->place_user(data);
|
||||
|
||||
side_assigned = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user