Lua call for loading .spr, .dat, .otb

This commit is contained in:
Sam 2014-01-18 18:38:13 +01:00
parent aec577a4b4
commit 27ae54d7d6
2 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,7 @@ bool SpriteManager::loadSpr(std::string file)
m_spritesCount = g_game.getFeature(Otc::GameSpritesU32) ? m_spritesFile->getU32() : m_spritesFile->getU16();
m_spritesOffset = m_spritesFile->tell();
m_loaded = true;
g_lua.callGlobalField("g_sprites", "onLoadSpr", file);
return true;
} catch(stdext::exception& e) {
g_logger.error(stdext::format("Failed to load sprites from '%s': %s", file, e.what()));

View File

@ -91,6 +91,7 @@ bool ThingTypeManager::loadDat(std::string file)
}
m_datLoaded = true;
g_lua.callGlobalField("g_things", "onLoadDat", file);
return true;
} catch(stdext::exception& e) {
g_logger.error(stdext::format("Failed to read dat '%s': %s'", file, e.what()));
@ -171,6 +172,7 @@ void ThingTypeManager::loadOtb(const std::string& file)
}
m_otbLoaded = true;
g_lua.callGlobalField("g_things", "onLoadOtb", file);
} catch(std::exception& e) {
g_logger.error(stdext::format("Failed to load '%s' (OTB file): %s", file, e.what()));
}