diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-01-02 17:44:00 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-01-02 17:44:00 +0200 |
commit | cd0019acd28bf7d2b6de44fc366804f0d17c80b2 (patch) | |
tree | f0eb4faef68cbeda4a6f9ded8afba66e064acdf7 /src | |
parent | e82a76e43848eae556843709b66b6c8703354931 (diff) | |
download | minetest-cd0019acd28bf7d2b6de44fc366804f0d17c80b2.tar.gz minetest-cd0019acd28bf7d2b6de44fc366804f0d17c80b2.tar.bz2 minetest-cd0019acd28bf7d2b6de44fc366804f0d17c80b2.zip |
Fix server sending stuff before textures have been sent
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 10 | ||||
-rw-r--r-- | src/server.cpp | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index 13d1e0c7d..0d08074ad 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1011,6 +1011,7 @@ void the_game( bool invert_mouse = g_settings->getBool("invert_mouse"); bool respawn_menu_active = false; + bool update_wielded_item_trigger = false; bool show_profiler = false; bool force_fog_off = false; @@ -1663,6 +1664,8 @@ void the_game( else if(event.type == CE_TEXTURES_UPDATED) { update_skybox(driver, tsrc, smgr, skybox, brightness); + + update_wielded_item_trigger = true; } } } @@ -2274,7 +2277,12 @@ void the_game( { //infostream<<"Updating local inventory"<<std::endl; client.getLocalInventory(local_inventory); - + + update_wielded_item_trigger = true; + } + if(update_wielded_item_trigger) + { + update_wielded_item_trigger = false; // Update wielded tool InventoryList *mlist = local_inventory.getList("main"); InventoryItem *item = NULL; diff --git a/src/server.cpp b/src/server.cpp index 5bd072d02..b76d0e41a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2140,9 +2140,6 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) m_con.Send(peer_id, 0, data, true); } - // Now the client should know about everything - getClient(peer_id)->definitions_sent = true; - // Send information about server to player in chat SendChatMessage(peer_id, getStatusString()); @@ -2849,6 +2846,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } SendTexturesRequested(peer_id, tosend); + + // Now the client should know about everything + // (definitions and textures) + getClient(peer_id)->definitions_sent = true; } else if(command == TOSERVER_INTERACT) { |