Skip to content

Commit

Permalink
Add compatibility mode (single threaded)
Browse files Browse the repository at this point in the history
This should work like stock Eluna
  • Loading branch information
Foereaper committed Jan 15, 2024
1 parent bbf3e41 commit 1292ba9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions ElunaLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ void ElunaLoader::LoadScripts()
ELUNA_LOG_ERROR("[Eluna]: Error tokenizing Eluna.OnlyOnMaps, invalid config value '%s'", mapIdStr.c_str());
}
}

preloadMaps = eConfigMgr->GetBoolDefault("Eluna.PreloadOnlyOnMaps", false);
}

int ElunaLoader::LoadBytecodeChunk(lua_State* /*L*/, uint8* bytes, size_t len, BytecodeBuffer* buffer)
Expand Down Expand Up @@ -244,16 +242,3 @@ bool ElunaLoader::ShouldMapLoadEluna(uint32 id)

return (std::find(requiredMaps.begin(), requiredMaps.end(), id) != requiredMaps.end());
}

void ElunaLoader::PreloadElunaMaps()
{
// Don't preload maps if not enabled or eluna has a state for every map.
if (!preloadMaps || !requiredMaps.size())
return;

for (uint32 mapId : requiredMaps)
{
// Creates the parent map for every entry in requiredMaps, will break if any emulator unloads parent maps.
sMapMgr->CreateBaseMap(mapId);
}
}
2 changes: 0 additions & 2 deletions ElunaLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class ElunaLoader
bool ShouldMapLoadEluna(uint32 mapId);
bool CompileScript(lua_State* L, LuaScript& script);
static int LoadBytecodeChunk(lua_State* L, uint8* bytes, size_t len, BytecodeBuffer* buffer);
void PreloadElunaMaps();

// Lua script folder path
std::string lua_folderpath;
Expand All @@ -49,7 +48,6 @@ class ElunaLoader
ScriptList lua_extensions;
std::vector<LuaScript> combined_scripts;
std::list<uint32> requiredMaps;
bool preloadMaps;
};

#define sElunaLoader ElunaLoader::instance()
Expand Down

0 comments on commit 1292ba9

Please sign in to comment.