refactor(Core): code cleanup (part 1) (#6361)

This commit is contained in:
Francesco Borzì
2021-06-16 12:58:14 +02:00
committed by GitHub
parent 7dd97ae679
commit 7d9fe22e28
13 changed files with 98 additions and 97 deletions

View File

@@ -624,21 +624,28 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui
case BG_SA_BLUE_GATE:
case BG_SA_GREEN_GATE:
{
GameObject* go = nullptr;
if ((go = GetBGObject(BG_SA_RED_GATE)))
go->SetDestructibleBuildingModifyState(true);
if ((go = GetBGObject(BG_SA_PURPLE_GATE)))
go->SetDestructibleBuildingModifyState(true);
if (auto redGate = GetBGObject(BG_SA_RED_GATE))
{
redGate->SetDestructibleBuildingModifyState(true);
}
if (auto purpleGate = GetBGObject(BG_SA_PURPLE_GATE))
{
purpleGate->SetDestructibleBuildingModifyState(true);
}
break;
}
case BG_SA_RED_GATE:
case BG_SA_PURPLE_GATE:
if (GameObject* go = GetBGObject(BG_SA_YELLOW_GATE))
go->SetDestructibleBuildingModifyState(true);
if (auto yellowGate = GetBGObject(BG_SA_YELLOW_GATE))
{
yellowGate->SetDestructibleBuildingModifyState(true);
}
break;
case BG_SA_YELLOW_GATE:
if (GameObject* go = GetBGObject(BG_SA_ANCIENT_GATE))
go->SetDestructibleBuildingModifyState(true);
if (auto ancientGate = GetBGObject(BG_SA_ANCIENT_GATE))
{
ancientGate->SetDestructibleBuildingModifyState(true);
}
break;
}
}
@@ -876,7 +883,7 @@ void BattlegroundSA::EventPlayerClickedOnFlag(Player* Source, GameObject* gameOb
break;
default:
return;
};
}
}
void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
@@ -996,7 +1003,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
default:
ABORT();
break;
};
}
}
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)