This commit is contained in:
quaK 2023-05-30 21:12:08 +03:00
parent 6150f2d45c
commit 382e78ca79

View File

@ -35,7 +35,7 @@ namespace gsc
std::unordered_map<std::string, std::uint32_t> init_handles; std::unordered_map<std::string, std::uint32_t> init_handles;
utils::memory::allocator scriptfile_allocator; utils::memory::allocator scriptfile_allocator;
std::unordered_map<std::string, game::ScriptFile*> loaded_scripts; std::unordered_map<const char*, game::ScriptFile*> loaded_scripts;
struct struct
{ {
@ -108,7 +108,7 @@ namespace gsc
game::ScriptFile* load_custom_script(const char* file_name, const std::string& real_name) game::ScriptFile* load_custom_script(const char* file_name, const std::string& real_name)
{ {
if (const auto itr = loaded_scripts.find(real_name); itr != loaded_scripts.end()) if (const auto itr = loaded_scripts.find(file_name); itr != loaded_scripts.end())
{ {
return itr->second; return itr->second;
} }
@ -170,7 +170,7 @@ namespace gsc
script_file_ptr->compressedLen = 0; script_file_ptr->compressedLen = 0;
loaded_scripts[real_name] = script_file_ptr; loaded_scripts[file_name] = script_file_ptr;
return script_file_ptr; return script_file_ptr;
} }