1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

server starting on port 0 on invalid settings

This commit is contained in:
Perttu Ahola
2010-12-22 17:58:02 +02:00
parent 3de176cc58
commit 58ccc68c81
6 changed files with 35 additions and 10 deletions

View File

@@ -277,11 +277,11 @@ int main(int argc, char *argv[])
// Port?
u16 port = 30000;
if(cmd_args.exists("port"))
if(cmd_args.exists("port") && cmd_args.getU16("port") != 0)
{
port = cmd_args.getU16("port");
}
else if(g_settings.exists("port"))
else if(g_settings.exists("port") && g_settings.getU16("port") != 0)
{
port = g_settings.getU16("port");
}