Core/DBC Move WorldSafeLocs.dbc storage to DB (#932)

This commit is contained in:
Kargatum
2019-01-08 13:37:31 +07:00
committed by Viste(Кирилл)
parent 3d416de893
commit 1a9f8dfc0c
38 changed files with 1262 additions and 414 deletions

View File

@@ -13,6 +13,7 @@
#include "Player.h"
#include "Util.h"
#include "WorldSession.h"
#include "GameGraveyard.h"
BattlegroundAB::BattlegroundAB()
{
@@ -424,10 +425,10 @@ void BattlegroundAB::EndBattleground(TeamId winnerTeamId)
_bgEvents.Reset();
}
WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
GraveyardStruct const* BattlegroundAB::GetClosestGraveyard(Player* player)
{
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[BG_AB_SPIRIT_ALIANCE + player->GetTeamId()]);
WorldSafeLocsEntry const* nearestEntry = entry;
GraveyardStruct const* entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[BG_AB_SPIRIT_ALIANCE + player->GetTeamId()]);
GraveyardStruct const* nearestEntry = entry;
float pX = player->GetPositionX();
float pY = player->GetPositionY();
@@ -437,7 +438,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
for (uint8 i = BG_AB_NODE_STABLES; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
if (_capturePointInfo[i]._ownerTeamId == player->GetTeamId())
{
entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[i]);
entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[i]);
dist = (entry->x - pX)*(entry->x - pX) + (entry->y - pY)*(entry->y - pY);
if (dist < minDist)
{