1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

disable all scripting code when configuring without scripting modules

This commit is contained in:
Andrey Filipenkov
2022-09-21 19:31:14 +03:00
parent 4058c2c18a
commit 7e6ed0583c
30 changed files with 124 additions and 10 deletions

View File

@@ -1652,7 +1652,9 @@ CGameHandler::~CGameHandler()
void CGameHandler::reinitScripting()
{
serverEventBus = make_unique<events::EventBus>();
#if SCRIPTING_ENABLED
serverScripts.reset(new scripting::PoolImpl(this, spellEnv));
#endif
}
void CGameHandler::init(StartInfo *si)
@@ -2112,7 +2114,9 @@ void CGameHandler::run(bool resume)
logGlobal->info(sbuffer.str());
}
#if SCRIPTING_ENABLED
services()->scripts()->run(serverScripts);
#endif
if(resume)
events::GameResumed::defaultExecute(serverEventBus.get());
@@ -7319,15 +7323,17 @@ CRandomGenerator & CGameHandler::getRandomGenerator()
return CRandomGenerator::getDefault();
}
#if SCRIPTING_ENABLED
scripting::Pool * CGameHandler::getGlobalContextPool() const
{
return serverScripts.get();
}
scripting::Pool * CGameHandler::getContextPool() const
scripting::Pool * CGameHandler::getContextPool() const
{
return serverScripts.get();
}
#endif
const ObjectInstanceID CGameHandler::putNewObject(Obj ID, int subID, int3 pos)
{