--- deliantra/server/common/exp.C 2009/11/11 03:52:44 1.24 +++ deliantra/server/common/exp.C 2010/04/09 17:44:17 1.28 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -79,11 +79,10 @@ static int has_ability (const object *ob) { - object *tmp; - - for (tmp = ob->inv; tmp != NULL; tmp = tmp->below) + for (object *tmp = ob->inv; tmp; tmp = tmp->below) if (tmp->type == SPELL || tmp->type == SPELLBOOK) return true; + return false; } @@ -129,12 +128,12 @@ exp *= (QUERY_FLAG (ob, FLAG_CAST_SPELL) && has_ability (ob)) ? (40 + (ob->stats.maxsp > 80 ? 80 : ob->stats.maxsp)) / 40 : 1; exp *= (80.0 / (70.0 + ob->stats.wc)) * (80.0 / (70.0 + ob->stats.ac)) * (50.0 + ob->stats.dam) / 50.0; exp *= att_mult * prot_mult * spec_mult; - exp *= 2.0 / (2.0 - ((fabs (ob->speed) < 0.95) ? fabs (ob->speed) : 0.95)); + exp *= 2.0 / (2.0 - min (ob->speed, 0.95)); exp *= (20.0 + ob->stats.Con) / 20.0; if (QUERY_FLAG (ob, FLAG_STAND_STILL)) exp /= 2; - return (int) exp; + return exp; } /* This loads the experience table from the exp_table @@ -144,7 +143,7 @@ * state. */ void -init_experience (void) +init_experience () { char buf[MAX_BUF], *cp; int lastlevel = 0, comp;