瀏覽代碼

More formatting

Victor Luchits 5 年之前
父節點
當前提交
f68b449e5e
共有 4 個文件被更改,包括 23 次插入13 次删除
  1. 3 3
      AI/BattleAI/AttackPossibility.cpp
  2. 2 1
      client/CMT.cpp
  3. 16 8
      lib/CStack.cpp
  4. 2 1
      lib/logging/CLogger.cpp

+ 3 - 3
AI/BattleAI/AttackPossibility.cpp

@@ -129,7 +129,8 @@ AttackPossibility AttackPossibility::evaluate(const BattleAttackInfo & attackInf
 			auto defenderState = u->acquireState();
 			ap.affectedUnits.push_back(defenderState);
 
-			for(int i = 0; i < totalAttacks; i++) {
+			for(int i = 0; i < totalAttacks; i++)
+			{
 				si64 damageDealt, damageReceived;
 
 				TDmgRange retaliation(0, 0);
@@ -173,9 +174,8 @@ AttackPossibility AttackPossibility::evaluate(const BattleAttackInfo & attackInf
 			}
 		}
 
-		if(!bestAp.dest.isValid() || ap.attackValue() > bestAp.attackValue()) {
+		if(!bestAp.dest.isValid() || ap.attackValue() > bestAp.attackValue())
 			bestAp = ap;
-		}
 	}
 
 	// check how much damage we gain from blocking enemy shooters on this hex

+ 2 - 1
client/CMT.cpp

@@ -1436,7 +1436,8 @@ void handleQuit(bool ask)
 			SDL_Quit();
 		}
 
-		if(logConfig != nullptr) {
+		if(logConfig != nullptr)
+		{
 			logConfig->deconfigure();
 			delete logConfig;
 			logConfig = nullptr;

+ 16 - 8
lib/CStack.cpp

@@ -265,29 +265,37 @@ std::vector<BattleHex> CStack::meleeAttackHexes(const battle::Unit * attacker, c
 	BattleHex otherAttackerPos = attackerPos + (attacker->unitSide() == BattleSide::ATTACKER ? -1 : 1);
 	BattleHex otherDefenderPos = defenderPos + (defender->unitSide() == BattleSide::ATTACKER ? -1 : 1);
 
-	if(BattleHex::mutualPosition(attackerPos, defenderPos) >= 0) { //front <=> front
-		if((mask & 1) == 0) {
+	if(BattleHex::mutualPosition(attackerPos, defenderPos) >= 0) //front <=> front
+	{
+		if((mask & 1) == 0)
+		{
 			mask |= 1;
 			res.push_back(defenderPos);
 		}
 	}
 	if (attacker->doubleWide() //back <=> front
-		&& BattleHex::mutualPosition(otherAttackerPos, defenderPos) >= 0) {
-		if((mask & 1) == 0) {
+		&& BattleHex::mutualPosition(otherAttackerPos, defenderPos) >= 0)
+	{
+		if((mask & 1) == 0)
+		{
 			mask |= 1;
 			res.push_back(defenderPos);
 		}
 	}
 	if (defender->doubleWide()//front <=> back
-		&& BattleHex::mutualPosition(attackerPos, otherDefenderPos) >= 0) {
-		if((mask & 2) == 0) {
+		&& BattleHex::mutualPosition(attackerPos, otherDefenderPos) >= 0)
+	{
+		if((mask & 2) == 0)
+		{
 			mask |= 2;
 			res.push_back(otherDefenderPos);
 		}
 	}
 	if (defender->doubleWide() && attacker->doubleWide()//back <=> back
-		&& BattleHex::mutualPosition(otherAttackerPos, otherDefenderPos) >= 0) {
-		if((mask & 2) == 0) {
+		&& BattleHex::mutualPosition(otherAttackerPos, otherDefenderPos) >= 0)
+	{
+		if((mask & 2) == 0)
+		{
 			mask |= 2;
 			res.push_back(otherDefenderPos);
 		}

+ 2 - 1
lib/logging/CLogger.cpp

@@ -403,6 +403,7 @@ void CLogFileTarget::write(const LogRecord & record)
 const CLogFormatter & CLogFileTarget::getFormatter() const { return formatter; }
 void CLogFileTarget::setFormatter(const CLogFormatter & formatter) { this->formatter = formatter; }
 
-CLogFileTarget::~CLogFileTarget() {
+CLogFileTarget::~CLogFileTarget()
+{
 	file.close();
 }