]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/main.cpp
Slightly improved version of mystrtok_r
[dragonfireclient.git] / src / main.cpp
index ede9f63b06477308d091263809190ade2e934259..6f4095148569525943577df13c89374603923b4e 100644 (file)
@@ -71,6 +71,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/string.h"
 #include "subgame.h"
 #include "quicktune.h"
+#include "serverlist.h"
 
 /*
        Settings.
@@ -1448,6 +1449,7 @@ int main(int argc, char *argv[])
                                menudata.trilinear_filter = g_settings->getBool("trilinear_filter");
                                menudata.enable_shaders = g_settings->getS32("enable_shaders");
                                menudata.preload_item_visuals = g_settings->getBool("preload_item_visuals");
+                               menudata.enable_particles = g_settings->getBool("enable_particles");
                                driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, menudata.mip_map);
                                menudata.creative_mode = g_settings->getBool("creative_mode");
                                menudata.enable_damage = g_settings->getBool("enable_damage");
@@ -1570,6 +1572,7 @@ int main(int argc, char *argv[])
 
                                g_settings->setS32("enable_shaders", menudata.enable_shaders);
                                g_settings->set("preload_item_visuals", itos(menudata.preload_item_visuals));
+                               g_settings->set("enable_particles", itos(menudata.enable_particles));
 
                                g_settings->set("creative_mode", itos(menudata.creative_mode));
                                g_settings->set("enable_damage", itos(menudata.enable_damage));
@@ -1579,7 +1582,7 @@ int main(int argc, char *argv[])
                                if(menudata.selected_world != -1)
                                        g_settings->set("selected_world_path",
                                                        worldspecs[menudata.selected_world].path);
-                               
+
                                // Break out of menu-game loop to shut down cleanly
                                if(device->run() == false || kill == true)
                                        break;
@@ -1596,6 +1599,15 @@ int main(int argc, char *argv[])
                                        current_address = "";
                                        current_port = 30011;
                                }
+                               else if (address != "")
+                               {
+                                       ServerListSpec server;
+                                       server.name = menudata.servername;
+                                       server.address = wide_to_narrow(menudata.address);
+                                       server.port = wide_to_narrow(menudata.port);
+                                       server.description = menudata.serverdescription;
+                                       ServerList::insert(server);
+                               }
                                
                                // Set world path to selected one
                                if(menudata.selected_world != -1){