unit health is no longer affected when unpausing during debug mode

This commit is contained in:
devZoGok
2024-10-20 15:27:57 +03:00
parent cd27ae9cfa
commit 253fff9dab
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -322,9 +322,11 @@ namespace battleship{
vector<int> currTechs = player->getTechnologies();
string name = unitTable["name"];
health = unitTable["health"]; health += game->calcAbilFromTech(Ability::Type::HEALTH, currTechs, (int)GameObject::type, id);
vehicle = unitTable["isVehicle"];
maxHealth = health;
health += game->calcAbilFromTech(Ability::Type::HEALTH, currTechs, (int)GameObject::type, id);
maxHealth = unitTable["health"];
if(health == 0) health = maxHealth;
lineOfSight = unitTable["lineOfSight"]; lineOfSight += game->calcAbilFromTech(Ability::Type::LINE_OF_SIGHT, currTechs, (int)GameObject::type, id);
unitClass = (UnitClass)unitTable["unitClass"];
+1 -1
View File
@@ -176,7 +176,7 @@ namespace battleship{
UnitType type;
std::vector<Order> orders;
std::string guiScreen = "";
int health, maxHealth, playerId, lenHpBar = 200;
int health = 0, maxHealth, playerId, lenHpBar = 200;
vb01::s64 orderLineDispTime = 0, lastFireTime = 0;
float lineOfSight;
std::vector<Armor> armorTypes;