mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-10-30 21:20:10 +00:00
Fix crashes.
This commit is contained in:
parent
528120d102
commit
ad66573a20
@ -45,10 +45,17 @@ bool Steam_GameServer::InitGameServer( uint32 unIP, uint16 usGamePort, uint16 us
|
|||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
|
||||||
if (logged_in) return false; // may not be changed after logged in.
|
if (logged_in) return false; // may not be changed after logged in.
|
||||||
|
if (!pchVersionString) pchVersionString = "";
|
||||||
|
|
||||||
std::string version(pchVersionString);
|
std::string version(pchVersionString);
|
||||||
version.erase(std::remove(version.begin(), version.end(), ' '), version.end());
|
version.erase(std::remove(version.begin(), version.end(), ' '), version.end());
|
||||||
version.erase(std::remove(version.begin(), version.end(), '.'), version.end());
|
version.erase(std::remove(version.begin(), version.end(), '.'), version.end());
|
||||||
server_data.set_version(stoi(version));
|
try {
|
||||||
|
server_data.set_version(std::stoi(version));
|
||||||
|
} catch (...) {
|
||||||
|
PRINT_DEBUG("InitGameServer: not a number: %s\n", pchVersionString);
|
||||||
|
server_data.set_version(0);
|
||||||
|
}
|
||||||
|
|
||||||
server_data.set_ip(unIP);
|
server_data.set_ip(unIP);
|
||||||
server_data.set_port(usGamePort);
|
server_data.set_port(usGamePort);
|
||||||
|
@ -801,11 +801,11 @@ void Steam_Overlay::OverlayProc()
|
|||||||
bool hidden = x.hidden && !achieved;
|
bool hidden = x.hidden && !achieved;
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text(x.title.c_str());
|
ImGui::Text("%s", x.title.c_str());
|
||||||
if (x.hidden) {
|
if (x.hidden) {
|
||||||
ImGui::Text("hidden achievement");
|
ImGui::Text("hidden achievement");
|
||||||
} else {
|
} else {
|
||||||
ImGui::TextWrapped(x.description.c_str());
|
ImGui::TextWrapped("%s", x.description.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (achieved) {
|
if (achieved) {
|
||||||
|
Loading…
Reference in New Issue
Block a user