Changeset 44 for trunk/src/game/Unit.cpp

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/Unit.cpp

    r37 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 "Totem.h" 
    4143#include "BattleGround.h" 
     44#include "OutdoorPvP.h" 
    4245#include "InstanceSaveMgr.h" 
    4346#include "GridNotifiersImpl.h" 
     
    634637        if(!spiritOfRedemtionTalentReady) 
    635638            pVictim->setDeathState(JUST_DIED); 
     639 
     640        // outdoor pvp things, do these after setting the death state, else the player activity notify won't work... doh... 
     641        // handle player kill only if not suicide (spirit of redemption for example) 
     642        if(GetTypeId() == TYPEID_PLAYER && this != pVictim) 
     643        { 
     644            if(OutdoorPvP * pvp = ((Player*)this)->GetOutdoorPvP()) 
     645            { 
     646                pvp->HandleKill((Player*)this,pVictim); 
     647            } 
     648        } 
     649 
     650        if(pVictim->GetTypeId() == TYPEID_PLAYER) 
     651        { 
     652            if(OutdoorPvP * pvp = ((Player*)pVictim)->GetOutdoorPvP()) 
     653            { 
     654                pvp->HandlePlayerActivityChanged((Player*)pVictim); 
     655            } 
     656        } 
    636657 
    637658        DEBUG_LOG("DealDamageHealth1"); 
     
    1056810589Unit* Unit::SelectNearbyTarget() const 
    1056910590{ 
    10570     CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY())); 
     10591    CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); 
    1057110592    Cell cell(p); 
    1057210593    cell.data.Part.reserved = ALL_DISTRICT; 
     
    1057610597 
    1057710598    { 
    10578         MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, ATTACK_DISTANCE); 
    10579         MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check); 
    10580  
    10581         TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
    10582         TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
     10599        Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, ATTACK_DISTANCE); 
     10600        Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check); 
     10601 
     10602        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); 
     10603        TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher); 
    1058310604 
    1058410605        CellLock<GridReadGuard> cell_lock(cell, p);