mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 12:36:45 +03:00
Made LUA script optional; Deleted my bugged test code for volumes;
This commit is contained in:
parent
7daed7abb6
commit
99f476f3b9
2 changed files with 15 additions and 10 deletions
|
@ -815,8 +815,11 @@ GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame)
|
|||
GameScriptLevel* level = g_GameFlow->Levels[index];
|
||||
std::string err;
|
||||
|
||||
if (!level->ScriptFileName.empty())
|
||||
{
|
||||
g_GameScript->ExecuteScript(level->ScriptFileName, err);
|
||||
g_GameScript->InitCallbacks();
|
||||
}
|
||||
|
||||
// Restore the game?
|
||||
if (loadFromSavegame)
|
||||
|
@ -955,10 +958,7 @@ void TestTriggers(short *data, int heavy, int HeavyFlags)
|
|||
{
|
||||
// Execute trigger
|
||||
//g_GameScript->ExecuteScript();
|
||||
Lara.gunType = WEAPON_UZI;
|
||||
}
|
||||
else
|
||||
Lara.gunType = WEAPON_NONE;
|
||||
|
||||
/*if (volumeBox.Intersects(laraBox))
|
||||
{
|
||||
|
|
|
@ -407,26 +407,31 @@ static void doCallback(sol::protected_function const & func) {
|
|||
|
||||
void GameScript::OnStart()
|
||||
{
|
||||
if (m_onStart.valid())
|
||||
doCallback(m_onStart);
|
||||
}
|
||||
|
||||
void GameScript::OnLoad()
|
||||
{
|
||||
if (m_onLoad.valid())
|
||||
doCallback(m_onLoad);
|
||||
}
|
||||
|
||||
void GameScript::OnControlPhase()
|
||||
{
|
||||
if (m_onControlPhase.valid())
|
||||
doCallback(m_onControlPhase);
|
||||
}
|
||||
|
||||
void GameScript::OnSave()
|
||||
{
|
||||
if (m_onSave.valid())
|
||||
doCallback(m_onSave);
|
||||
}
|
||||
|
||||
void GameScript::OnEnd()
|
||||
{
|
||||
if (m_onEnd.valid())
|
||||
doCallback(m_onEnd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue