aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level1.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-10 00:59:10 -0600
committermegamage <none@none>2009-02-10 00:59:10 -0600
commitfe85f521424656dedfb2fa189987be7ccb304ee7 (patch)
tree22fb88beed259416033d3cb661537ef8e69a0430 /src/game/Level1.cpp
parent7f39dbd8481bbc629deb0726e8fad976bf6995ed (diff)
[7252] Move all world global broadcast string (all arena/bg related) to `mangos_string`.
PLEASE, NOT USE string world broadcasts in real code. This function _only_ for debug purposes. Really allow with .debug bg start bg with 1 player. Added helps for some existed .debug commands. Author: VladimirMangos --HG-- branch : trunk
Diffstat (limited to 'src/game/Level1.cpp')
-rw-r--r--src/game/Level1.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 48b2b57355f..86a2ce95d25 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -767,10 +767,23 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
if(pMap->IsBattleGroundOrArena())
{
- // cannot summon to bg
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_BG,nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
+ // only allow if gm mode is on
+ if (!chr->isGameMaster())
+ {
+ 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())
{
@@ -877,8 +890,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
SetSentErrorMessage(true);
return false;
}
- // if already in a bg, don't let port to other
- else if (_player->GetBattleGroundId())
+ // if both players are in different bgs
+ else if (_player->GetBattleGroundId() && _player->GetBattleGroundId() != chr->GetBattleGroundId())
{
PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
SetSentErrorMessage(true);
@@ -888,7 +901,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
// when porting out from the bg, it will be reset to 0
_player->SetBattleGroundId(chr->GetBattleGroundId());
}
- else if(cMap->IsDungeon())
+ else if(cMap->IsDungeon() && cMap->Instanceable())
{
Map* pMap = MapManager::Instance().GetMap(_player->GetMapId(),_player);