From: nethack.rankin Date: Wed, 20 Nov 2002 22:44:15 +0000 (+0000) Subject: fix B14013 - experience calculation X-Git-Tag: MOVE2GIT~2329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5701729bc15cde932c90e23f920a3c5a098c5b7e;p=nethack fix B14013 - experience calculation Put in the missing parentheses that reported; I don't know how much that's going to impact experience calculations. Also, update some related code that didn't reflect the increase in default speed from 10 to 12 back in 3.3.0. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 7cdc789ff..8d5d7cf4b 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -308,6 +308,7 @@ level teleport while on a sleeping steed caused panic and possible crash breaking wand of digging causing a shopkeeper to fall left unpaid items unpaid use get_adjacent_loc() rather than getdir() directly for some things where you want to ensure valid adjacent coordinates are returned +minor experience calculation tweaks Platform- and/or Interface-Specific Fixes diff --git a/src/exper.c b/src/exper.c index 932b2833a..649f1c689 100644 --- a/src/exper.c +++ b/src/exper.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)exper.c 3.4 2002/07/11 */ +/* SCCS Id: @(#)exper.c 3.4 2002/11/20 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -49,10 +49,11 @@ experience(mtmp, nk) /* return # of exp points for mtmp after nk killed */ tmp = 1 + mtmp->m_lev * mtmp->m_lev; /* For higher ac values, give extra experience */ - if((i = find_mac(mtmp)) < 3) tmp += (7 - i) * (i < 0) ? 2 : 1; + if ((i = find_mac(mtmp)) < 3) tmp += (7 - i) * ((i < 0) ? 2 : 1); /* For very fast monsters, give extra experience */ - if(ptr->mmove >= 12) tmp += (ptr->mmove >= 18) ? 5 : 3; + if (ptr->mmove > NORMAL_SPEED) + tmp += (ptr->mmove > (3*NORMAL_SPEED/2)) ? 5 : 3; /* For each "special" attack type give extra experience */ for(i = 0; i < NATTK; i++) {