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

[svn] * Fixed xp calculation for low level characters when grouped with a higher level player. Patch provided by Reiner030.
* Fixed positive spells being not resistable when cast on hostile units. Patch provided by QAston.
* Fixed compile warnings in gcc. Patch provided by WarHead?.

Original author: w12x
Date: 2008-10-26 11:50:07-05:00

Files:
1 modified

Legend:

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

    r102 r111  
    2727#include "ObjectMgr.h" 
    2828#include "Group.h" 
     29#include "Formulas.h" 
    2930#include "ObjectAccessor.h" 
    3031#include "BattleGround.h" 
     
    786787} 
    787788 
    788 void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level) 
     789void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level) 
    789790{ 
    790791    for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) 
     
    799800        ++count; 
    800801        sum_level += member->getLevel(); 
     802        // store maximum member level 
    801803        if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel()) 
    802804            member_with_max_level = member; 
     805 
     806        uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel()); 
     807        // if the victim is higher level than the gray level of the currently examined group member, 
     808        // then set not_gray_member_with_max_level if needed. 
     809        if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level 
     810           || not_gray_member_with_max_level->getLevel() < member->getLevel())) 
     811            not_gray_member_with_max_level = member; 
    803812    } 
    804813}