Corregido: Bug al cargar un config.txt sin valor en el puerto del server

This commit is contained in:
2022-11-17 08:04:14 +01:00
parent 09560a001c
commit 8e609b2e3b

View File

@@ -331,6 +331,7 @@ void Director::initOptions()
// Online
options->online.enabled = false;
options->online.server = "";
options->online.port = 0;
options->online.gameID = "coffee_crisis";
options->online.jailerID = "";
options->online.score = 0;
@@ -686,6 +687,10 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
else if (var == "port")
{
if (value == "")
{
value = "0";
}
options->online.port = std::stoi(value);
}