Changeset 44 for trunk/src/game/Unit.cpp
- Timestamp:
- 11/19/08 13:27:40 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Unit.cpp
r37 r44 1 1 /* 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/> 3 5 * 4 6 * This program is free software; you can redistribute it and/or modify … … 9 11 * This program is distributed in the hope that it will be useful, 10 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 14 * GNU General Public License for more details. 13 15 * 14 16 * You should have received a copy of the GNU General Public License 15 17 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 19 */ 18 20 … … 40 42 #include "Totem.h" 41 43 #include "BattleGround.h" 44 #include "OutdoorPvP.h" 42 45 #include "InstanceSaveMgr.h" 43 46 #include "GridNotifiersImpl.h" … … 634 637 if(!spiritOfRedemtionTalentReady) 635 638 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 } 636 657 637 658 DEBUG_LOG("DealDamageHealth1"); … … 10568 10589 Unit* Unit::SelectNearbyTarget() const 10569 10590 { 10570 CellPair p( MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));10591 CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); 10571 10592 Cell cell(p); 10572 10593 cell.data.Part.reserved = ALL_DISTRICT; … … 10576 10597 10577 10598 { 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); 10583 10604 10584 10605 CellLock<GridReadGuard> cell_lock(cell, p);