Changeset 9 for trunk/src/game/Level1.cpp
- Timestamp:
- 11/19/08 13:22:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Level1.cpp
r6 r9 316 316 Map* pMap = MapManager::Instance().GetMap(m_session->GetPlayer()->GetMapId(),m_session->GetPlayer()); 317 317 318 if(pMap->Instanceable()) 318 if(pMap->IsBattleGroundOrArena()) 319 { 320 // cannot summon to bg 321 SendSysMessage(LANG_CANNOT_SUMMON_TO_BG); 322 SetSentErrorMessage(true); 323 return false; 324 } 325 else if(pMap->IsDungeon()) 319 326 { 320 327 Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr); … … 402 409 { 403 410 Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr); 404 if(cMap->Instanceable()) 411 if(cMap->IsBattleGroundOrArena()) 412 { 413 // only allow if gm mode is on 414 if (!_player->isGameMaster()) 415 { 416 SendSysMessage(LANG_CANNOT_GO_TO_BG_GM); 417 SetSentErrorMessage(true); 418 return false; 419 } 420 // if already in a bg, don't let port to other 421 else if (_player->GetBattleGroundId()) 422 { 423 SendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG); 424 SetSentErrorMessage(true); 425 return false; 426 } 427 // all's well, set bg id 428 // when porting out from the bg, it will be reset to 0 429 _player->SetBattleGroundId(chr->GetBattleGroundId()); 430 } 431 else if(cMap->IsDungeon()) 405 432 { 406 433 Map* pMap = MapManager::Instance().GetMap(_player->GetMapId(),_player); … … 1586 1613 // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r 1587 1614 GameTele const* tele = extractGameTeleFromLink((char*)args); 1588 1589 1615 if (!tele) 1590 1616 { 1591 1617 SendSysMessage(LANG_COMMAND_TELE_NOTFOUND); 1618 SetSentErrorMessage(true); 1619 return false; 1620 } 1621 1622 MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 1623 if(!me || me->IsBattleGroundOrArena()) 1624 { 1625 SendSysMessage(LANG_CANNOT_TELE_TO_BG); 1592 1626 SetSentErrorMessage(true); 1593 1627 return false; … … 1866 1900 } 1867 1901 1902 MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 1903 if(!me || me->IsBattleGroundOrArena()) 1904 { 1905 SendSysMessage(LANG_CANNOT_TELE_TO_BG); 1906 SetSentErrorMessage(true); 1907 return false; 1908 } 1909 1868 1910 Player *chr = objmgr.GetPlayer(name.c_str()); 1869 1911 if (chr) … … 1928 1970 } 1929 1971 1972 MapEntry const * me = sMapStore.LookupEntry(tele->mapId); 1973 if(!me || me->IsBattleGroundOrArena()) 1974 { 1975 SendSysMessage(LANG_CANNOT_TELE_TO_BG); 1976 SetSentErrorMessage(true); 1977 return false; 1978 } 1930 1979 Group *grp = player->GetGroup(); 1931 1980 if(!grp)