PDA

View Full Version : Experiencelog.cpp - sanity check in addExpRecord patch



Lisa
10-29-2002, 06:10 PM
http://sourceforge.net/tracker/download.php?group_id=10131&atid=310131&file_id=34226&aid=630802

http://sourceforge.net/tracker/index.php?func=detail&aid=630802&group_id=10131&atid=310131



? diff-file
Index: experiencelog.cpp
================================================== =================
RCS file: /cvsroot/seq/showeq/src/experiencelog.cpp,v
retrieving revision 1.10
diff -c -r1.10 experiencelog.cpp
*** experiencelog.cpp6 Jun 2002 07:42:45 -00001.10
--- experiencelog.cpp29 Oct 2002 23:49:27 -0000
***************
*** 278,284 ****
void ExperienceWindow::addExpRecord(const QString &mob_name,
int mob_level, long xp_gained, QString zone_name )
{
!
ExperienceRecord *xp = new ExperienceRecord( mob_name, mob_level,
xp_gained, time(0), zone_name, m_player, m_group);

--- 278,290 ----
void ExperienceWindow::addExpRecord(const QString &mob_name,
int mob_level, long xp_gained, QString zone_name )
{
! /*sanity check xp gain so we don't mess up the aggregate
! xp stats in the window
! */
! if ((xp_gained < 1) || (xp_gained > 1000000)) {
! return;
! } //end sanity check
!
ExperienceRecord *xp = new ExperienceRecord( mob_name, mob_level,
xp_gained, time(0), zone_name, m_player, m_group);

Ratt
10-30-2002, 12:37 AM
Mobs in PoP are giving > 1,000,000 experience... so your sanity check would fail ;)

Lisa
10-30-2002, 12:57 AM
Originally posted by Ratt
Mobs in PoP are giving > 1,000,000 experience... so your sanity check would fail ;)

:o

I don't have PoP, so I don't care! *LAUGH*

hehe, so just change it to some larger value :p

Besides, its just a quick fix to a bigger problem... Perhaps a rez-detection algorithm...