[Menus] Small fixes

This commit is contained in:
momo5502 2017-01-22 19:05:50 +01:00
parent 1a0fedf591
commit 7fa8742c29

View File

@ -28,6 +28,7 @@ namespace Components
Game::script_t* Menus::LoadMenuScript(std::string name, std::string buffer) Game::script_t* Menus::LoadMenuScript(std::string name, std::string buffer)
{ {
Game::script_t* script = Game::Script_Alloc(sizeof(Game::script_t) + 1 + buffer.length()); Game::script_t* script = Game::Script_Alloc(sizeof(Game::script_t) + 1 + buffer.length());
if (!script) return nullptr;
strcpy_s(script->filename, sizeof(script->filename), name.data()); strcpy_s(script->filename, sizeof(script->filename), name.data());
script->buffer = reinterpret_cast<char*>(script + 1); script->buffer = reinterpret_cast<char*>(script + 1);
@ -266,11 +267,7 @@ namespace Components
for (int i = 0; i < menuList->menuCount; ++i) for (int i = 0; i < menuList->menuCount; ++i)
{ {
if (!menuList->menus[i]) if (!menuList->menus[i]) continue;
{
continue;
}
Utils::Merge(&menus, Menus::LoadMenu(menuList->menus[i])); Utils::Merge(&menus, Menus::LoadMenu(menuList->menus[i]));
} }