mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
Core/DBC Move WorldSafeLocs.dbc storage to DB (#932)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "Transport.h"
|
||||
#include "WorldSession.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
BattlegroundIC::BattlegroundIC()
|
||||
{
|
||||
@@ -950,7 +951,7 @@ void BattlegroundIC::EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/
|
||||
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
GraveyardStruct const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
// Is there any occupied node for this team?
|
||||
std::vector<uint8> nodes;
|
||||
@@ -958,7 +959,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
if (nodePoint[i].faction == player->GetTeamId() && !nodePoint[i].needChange) // xinef: controlled by faction and not contested!
|
||||
nodes.push_back(i);
|
||||
|
||||
WorldSafeLocsEntry const* good_entry = NULL;
|
||||
GraveyardStruct const* good_entry = NULL;
|
||||
// If so, select the closest node to place ghost on
|
||||
if (!nodes.empty())
|
||||
{
|
||||
@@ -968,7 +969,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
float mindist = 999999.0f;
|
||||
for (uint8 i = 0; i < nodes.size(); ++i)
|
||||
{
|
||||
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]);
|
||||
GraveyardStruct const*entry = sGraveyard->GetGraveyard(BG_IC_GraveyardIds[nodes[i]]);
|
||||
if (!entry)
|
||||
continue;
|
||||
float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y);
|
||||
@@ -982,7 +983,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
}
|
||||
// If not, place ghost on starting location
|
||||
if (!good_entry)
|
||||
good_entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[player->GetTeamId()+MAX_NODE_TYPES]);
|
||||
good_entry = sGraveyard->GetGraveyard(BG_IC_GraveyardIds[player->GetTeamId()+MAX_NODE_TYPES]);
|
||||
|
||||
return good_entry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user