Show
Ignore:
Timestamp:
11/19/08 13:27:40 (17 years ago)
Author:
yumileroy
Message:

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectAccessor.cpp

    r2 r44  
    11/* 
    2  * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> 
     2 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> 
     3 * 
     4 * Thanks to the original authors: MaNGOS <http://www.mangosproject.org/> 
    35 * 
    46 * This program is free software; you can redistribute it and/or modify 
     
    911 * This program is distributed in the hope that it will be useful, 
    1012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    1214 * GNU General Public License for more details. 
    1315 * 
    1416 * You should have received a copy of the GNU General Public License 
    1517 * along with this program; if not, write to the Free Software 
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    1719 */ 
    1820 
     
    4042#include <cmath> 
    4143 
    42 #define CLASS_LOCK MaNGOS::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex> 
     44#define CLASS_LOCK Trinity::ClassLevelLockable<ObjectAccessor, ZThread::FastMutex> 
    4345INSTANTIATE_SINGLETON_2(ObjectAccessor, CLASS_LOCK); 
    4446INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ZThread::FastMutex); 
    4547 
    46 namespace MaNGOS 
    47 { 
    48  
    49     struct MANGOS_DLL_DECL BuildUpdateForPlayer 
     48namespace Trinity 
     49{ 
     50 
     51    struct TRINITY_DLL_DECL BuildUpdateForPlayer 
    5052    { 
    5153        Player &i_player; 
     
    353355ObjectAccessor::_buildChangeObjectForPlayer(WorldObject *obj, UpdateDataMapType &update_players) 
    354356{ 
    355     CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); 
     357    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); 
    356358    Cell cell(p); 
    357359    cell.data.Part.reserved = ALL_DISTRICT; 
     
    393395 
    394396    // build mapid*cellid -> guid_set map 
    395     CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); 
     397    CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); 
    396398    uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 
    397399 
     
    412414 
    413415    // build mapid*cellid -> guid_set map 
    414     CellPair cell_pair = MaNGOS::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); 
     416    CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); 
    415417    uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; 
    416418 
     
    522524        Map *map; 
    523525 
    524         MaNGOS::ObjectUpdater updater(diff); 
     526        Trinity::ObjectUpdater updater(diff); 
    525527        // for creature 
    526         TypeContainerVisitor<MaNGOS::ObjectUpdater, GridTypeMapContainer  > grid_object_update(updater); 
     528        TypeContainerVisitor<Trinity::ObjectUpdater, GridTypeMapContainer  > grid_object_update(updater); 
    527529        // for pets 
    528         TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater); 
     530        TypeContainerVisitor<Trinity::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater); 
    529531 
    530532        for(CreatureLocationHolderType::iterator iter=creature_locations.begin(); iter != creature_locations.end(); ++iter) 
     
    538540            map = MapManager::Instance().GetMap((*iter).first, player); 
    539541 
    540             CellPair standing_cell(MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY())); 
     542            CellPair standing_cell(Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY())); 
    541543 
    542544            // Check for correctness of standing_cell, it also avoids problems with update_cell 
     
    591593            continue; 
    592594 
    593         CellPair p = MaNGOS::ComputeCellPair(iter->second->GetPositionX(), iter->second->GetPositionY()); 
     595        CellPair p = Trinity::ComputeCellPair(iter->second->GetPositionX(), iter->second->GetPositionY()); 
    594596        if( (cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) && 
    595597            (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) ) 
     
    611613ObjectAccessor::UpdateObjectVisibility(WorldObject *obj) 
    612614{ 
    613     CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); 
     615    CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); 
    614616    Cell cell(p); 
    615617 
     
    619621void ObjectAccessor::UpdateVisibilityForPlayer( Player* player ) 
    620622{ 
    621     CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); 
     623    CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); 
    622624    Cell cell(p); 
    623625    Map* m = MapManager::Instance().GetMap(player->GetMapId(),player);