main scripts are loaded once

This commit is contained in:
devZoGok
2022-12-03 18:27:17 +02:00
parent 919d6155e5
commit 16b4886ebf
8 changed files with 20 additions and 25 deletions
-3
View File
@@ -63,8 +63,6 @@ namespace battleship{
int unitId = atoi(fullCommand[2].c_str());
LuaManager *lm = LuaManager::getSingleton();
string pathBase = GameManager::getSingleton()->getPath() + "Scripts/";
lm->buildScript(vector<string>{pathBase + "defPaths.lua", pathBase + "unitData.lua"});
if(!(0 <= unitId && unitId <= lm->getInt("numUnits")))
return;
@@ -78,7 +76,6 @@ namespace battleship{
Vehicle *vehicle = nullptr;
LuaManager *luaManager = LuaManager::getSingleton();
luaManager->buildScript(vector<string>{gm->getPath() + "Scripts/unitData.lua"});
int unitClass = luaManager->getIntFromTable("unitClass", vector<Index>{Index(unitId + 1)});
switch((UnitClass)unitClass){