Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Sogou, Bing

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
633
Rhyader
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » xp_compute
Forum Rules | Mark all | Recent Posts

xp_compute
< Newer Topic :: Older Topic > Something smells fishy here....

Pages:<< prev 1 next >>
Post is unread #1 Sep 5, 2005, 12:56 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,644
JoinedJan 1, 2002

This section in xp_compute seems wrong:

   /*
    * semi-intelligent experienced player vs. novice player xp gain
    * "bell curve"ish xp mod by Thoric
    * based on time played vs. level
    */
   if( !IS_NPC( gch ) && gchlev > 5 )
   {
      xp_ratio = ( int )gch->played / gchlev;
      if( xp_ratio > 20000 )  /* 5/4 */
         xp = ( xp * 5 ) >> 2;
      else if( xp_ratio < 16000 )   /* 3/4 */
         xp = ( xp * 3 ) >> 2;
      else if( xp_ratio < 10000 )   /* 1/2 */
         xp >>= 1;
      else if( xp_ratio < 5000 ) /* 1/4 */
         xp >>= 2;
      else if( xp_ratio < 3500 ) /* 1/8 */
         xp >>= 3;
      else if( xp_ratio < 2000 ) /* 1/16 */
         xp >>= 4;
   }


Am I missing something or won't the check marked as 3/4 mean the rest never get checked since 10000, 5000, 3500, and 2000 are *ALL* less than 16000? I am running through the code with the gcc flag -Wunreachable-code and it didn't flag this section in FUSS but did catch it in AFKMud so I'm wondering if either I'm wrong in what looks logical or if GCC missed this and this needs to be corrected.
       
Post is unread #2 Sep 5, 2005, 6:25 am
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

I think that they should all be > checks instead of <. If you correct 16000 you'll never hit anything below 10000. 4500 looks like it should match on the 5000 check, but it is still less that 10000, so it will hit there instead. So yes, your right, thats wrong.

Wonder why it would be caught in the one and not the other, though.
       
Pages:<< prev 1 next >>