factored out initFx method

refactored creation of explosion FX
This commit is contained in:
devZoGok
2025-06-07 20:49:06 +03:00
parent 2638f9b3a1
commit 5421e6003f
11 changed files with 238 additions and 221 deletions
+4 -1
View File
@@ -325,7 +325,10 @@ namespace battleship{
displayUnitStats(slot.foreground, slot.background, (int)((bool)slot.vehicle), (int)true, renderSelectables, slot.offset);
if (health <= DEATH_HP){
Environment::explode(pos, 0, 0, deathSfx);
FxManager *fxManager = FxManager::getSingleton();
FxManager::Fx *deathFx = fxManager->initFx(generateView()[getGameObjTableName()][id + 1]["deathFx"], model, false, pos);
deathFx->toggleComponents(true);
fxManager->addFx(deathFx);
remove = true;
}