mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 17:28:14 +00:00
Add a player removal,
and tidy the code so that no spurious 'unknown side -1' happens.
This commit is contained in:
parent
2c7967db1b
commit
3988797dd1
@ -909,7 +909,6 @@ void mp_connect::update_network()
|
|||||||
changes = true;
|
changes = true;
|
||||||
i->second = 0;
|
i->second = 0;
|
||||||
i->first->values.erase("taken");
|
i->first->values.erase("taken");
|
||||||
|
|
||||||
remove_player(i->first->values["description"]);
|
remove_player(i->first->values["description"]);
|
||||||
i->first->values["description"] = "";
|
i->first->values["description"] = "";
|
||||||
}
|
}
|
||||||
@ -939,9 +938,11 @@ void mp_connect::update_network()
|
|||||||
if(pos != positions_.end()) {
|
if(pos != positions_.end()) {
|
||||||
pos->second = 0;
|
pos->second = 0;
|
||||||
pos->first->values.erase("taken");
|
pos->first->values.erase("taken");
|
||||||
|
remove_player(pos->first->values["description"]);
|
||||||
pos->first->values["description"] = "";
|
pos->first->values["description"] = "";
|
||||||
network::send_data(*level_);
|
network::send_data(*level_);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int side_taken = atoi(cfg["side"].c_str())-1;
|
int side_taken = atoi(cfg["side"].c_str())-1;
|
||||||
@ -1026,8 +1027,6 @@ void mp_connect::update_network()
|
|||||||
} else {
|
} else {
|
||||||
std::cerr << "tried to take illegal side: " << side_taken << "\n";
|
std::cerr << "tried to take illegal side: " << side_taken << "\n";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
std::cerr << "tried to take unknown side: " << side_taken << "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user