// Deinitialize scripting
infostream << "Server: Deinitializing scripting" << std::endl;
delete m_script;
+ delete m_startup_server_map; // if available
delete m_game_settings;
while (!m_unsent_map_edit_queue.empty()) {
// Create the Map (loads map_meta.txt, overriding configured mapgen params)
ServerMap *servermap = new ServerMap(m_path_world, this, m_emerge, m_metrics_backend.get());
+ m_startup_server_map = servermap;
// Initialize scripting
infostream << "Server: Initializing Lua" << std::endl;
m_craftdef->initHashes(this);
// Initialize Environment
+ m_startup_server_map = nullptr; // Ownership moved to ServerEnvironment
m_env = new ServerEnvironment(servermap, m_script, this, m_path_world);
m_inventory_mgr->setEnv(m_env);
PlayerSAO *sao = player->getPlayerSAO();
assert(sao);
+ // Send attachment updates instantly to the client prior updating position
+ sao->sendOutdatedData();
+
NetworkPacket pkt(TOCLIENT_MOVE_PLAYER, sizeof(v3f) + sizeof(f32) * 2, peer_id);
pkt << sao->getBasePosition() << sao->getLookPitch() << sao->getRotation().Y;
// Collect all media file paths
std::vector<std::string> paths;
- // The paths are ordered in descending priority
+
+ // ordered in descending priority
+ paths.push_back(getBuiltinLuaPath() + DIR_DELIM + "locale");
fs::GetRecursiveDirs(paths, porting::path_user + DIR_DELIM + "textures" + DIR_DELIM + "server");
fs::GetRecursiveDirs(paths, m_gamespec.path + DIR_DELIM + "textures");
m_modmgr->getModsMediaPaths(paths);