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
@@ -44,9 +44,6 @@ namespace battleship{
void Projectile::initProperties(int weaponId){
LuaManager *lm = LuaManager::getSingleton();
string pathBase = GameManager::getSingleton()->getPath() + "Scripts/";
lm->buildScript(vector<string>{pathBase + "defPaths.lua", pathBase + "unitData.lua", pathBase + "projectileData.lua"});
vector<Index> indices = vector<Index>{Index(id + 1), Index(weaponTypeId + 1), Index(weaponId + 1)};
rayLength = lm->getFloatFromTable("rayLength", indices);
damage = lm->getIntFromTable("damage", indices);