point defenses aim vertically towards missiles

This commit is contained in:
devZoGok
2025-12-05 14:43:18 +02:00
parent 1d0bf8d349
commit 1cfa181918
6 changed files with 104 additions and 50 deletions
+9 -2
View File
@@ -13,6 +13,7 @@
#include <ext.hpp>
#include "unit.h"
#include "cryoGun.h"
#include "weapon.h"
#include "util.h"
#include "game.h"
@@ -141,8 +142,14 @@ namespace battleship{
if(wtOpt != sol::nullopt) wt = unitTable[tblName][i + 1]["type"];
Weapon *weapon = ((Weapon::Type)wt == Weapon::Type::FREEZER ? new CryoGun(this, unitTable, i) : new Weapon(this, unitTable, i));
weapons.push_back(weapon);
switch((Weapon::Type)wt){
case Weapon::Type::FREEZER:
weapons.push_back(new CryoGun(this, unitTable, i));
break;
default:
weapons.push_back(new Weapon(this, unitTable, i));
break;
}
}
}
}