mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7261] Better check DB corrdinates for bg entry at player loading.
This commit is contained in:
parent
09bf9260cb
commit
f58d1a179a
2 changed files with 6 additions and 3 deletions
|
|
@ -14162,7 +14162,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
SetBattleGroundEntryPoint(fields[36].GetUInt32(),fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
|
SetBattleGroundEntryPoint(fields[36].GetUInt32(),fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
|
||||||
|
|
||||||
// check entry point and fix to homebind if need
|
// check entry point and fix to homebind if need
|
||||||
if(!MapManager::IsValidMapCoord(m_bgEntryPoint))
|
MapEntry const* mapEntry = sMapStore.LookupEntry(m_bgEntryPoint.mapid);
|
||||||
|
if(!mapEntry || mapEntry->Instanceable() || !MapManager::IsValidMapCoord(m_bgEntryPoint))
|
||||||
SetBattleGroundEntryPoint(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ,0.0f);
|
SetBattleGroundEntryPoint(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ,0.0f);
|
||||||
|
|
||||||
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid);
|
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid);
|
||||||
|
|
@ -14193,8 +14194,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
// return to BG master
|
// return to BG master
|
||||||
SetMapId(fields[36].GetUInt32());
|
SetMapId(fields[36].GetUInt32());
|
||||||
Relocate(fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
|
Relocate(fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat());
|
||||||
|
|
||||||
// check entry point and fix to homebind if need
|
// check entry point and fix to homebind if need
|
||||||
if(!IsPositionValid())
|
mapEntry = sMapStore.LookupEntry(GetMapId());
|
||||||
|
if(!mapEntry || mapEntry->IsBattleGroundOrArena() || !IsPositionValid())
|
||||||
RelocateToHomebind();
|
RelocateToHomebind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7260"
|
#define REVISION_NR "7261"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue