mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
allow .goname and .namego in more battleground cases
Signed-off-by: balrok <der-coole-carl@gmx.net>
This commit is contained in:
parent
804166739d
commit
22cb305002
1 changed files with 20 additions and 9 deletions
|
|
@ -365,10 +365,23 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||||
|
|
||||||
if(pMap->IsBattleGroundOrArena())
|
if(pMap->IsBattleGroundOrArena())
|
||||||
{
|
{
|
||||||
// cannot summon to bg
|
// only allow if gm mode is on
|
||||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_BG,nameLink.c_str());
|
if (!chr->isGameMaster())
|
||||||
SetSentErrorMessage(true);
|
{
|
||||||
return false;
|
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chr->GetName());
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// if both players are in different bgs
|
||||||
|
else if (chr->GetBattleGroundId() && m_session->GetPlayer()->GetBattleGroundId() != chr->GetBattleGroundId())
|
||||||
|
{
|
||||||
|
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chr->GetName());
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// all's well, set bg id
|
||||||
|
// when porting out from the bg, it will be reset to 0
|
||||||
|
chr->SetBattleGroundId(m_session->GetPlayer()->GetBattleGroundId());
|
||||||
}
|
}
|
||||||
else if(pMap->IsDungeon())
|
else if(pMap->IsDungeon())
|
||||||
{
|
{
|
||||||
|
|
@ -475,8 +488,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// if already in a bg, don't let port to other
|
// if both players are in different bgs
|
||||||
else if (_player->GetBattleGroundId())
|
else if (_player->GetBattleGroundId() && _player->GetBattleGroundId() != chr->GetBattleGroundId())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
|
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -486,9 +499,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||||
// when porting out from the bg, it will be reset to 0
|
// when porting out from the bg, it will be reset to 0
|
||||||
_player->SetBattleGroundId(chr->GetBattleGroundId());
|
_player->SetBattleGroundId(chr->GetBattleGroundId());
|
||||||
}
|
}
|
||||||
else if(cMap->IsDungeon())
|
else if(cMap->IsDungeon() && cMap->Instanceable())
|
||||||
Map* cMap = chr->GetMap();
|
|
||||||
if(cMap->Instanceable())
|
|
||||||
{
|
{
|
||||||
// we have to go to instance, and can go to player only if:
|
// we have to go to instance, and can go to player only if:
|
||||||
// 1) we are in his group (either as leader or as member)
|
// 1) we are in his group (either as leader or as member)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue