--- deliantra/server/common/living.C 2012/01/27 22:00:39 1.127 +++ deliantra/server/common/living.C 2012/11/12 10:32:18 1.130 @@ -1,24 +1,24 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. - * + * * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 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 * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the Affero GNU General Public License * and the GNU General Public License along with this program. If not, see * . - * + * * The authors can be reached via e-mail to */ @@ -35,7 +35,7 @@ 22, 25, 30, 40, 50 }; -/* changed the name of this to "sp_bonus" from "int_bonus" +/* changed the name of this to "sp_bonus" from "int_bonus" * because Pow can now be the stat that controls spellpoint * advancement. -b.t. */ @@ -110,13 +110,13 @@ */ const uint32 weight_limit[MAX_STAT + 1] = { - 200000, /* 0 */ - 250000, 300000, 350000, 400000, 500000, /* 5 */ - 600000, 700000, 800000, 900000, 1000000, /* 10 */ + 200000, /* 0 */ + 250000, 300000, 350000, 400000, 500000, /* 5 */ + 600000, 700000, 800000, 900000, 1000000, /* 10 */ 1100000, 1200000, 1300000, 1400000, 1500000, /* 15 */ 1650000, 1800000, 1950000, 2100000, 2250000, /* 20 */ 2400000, 2550000, 2700000, 2850000, 3000000, /* 25 */ - 3250000, 3500000, 3750000, 4000000, 4500000 /*30 */ + 3250000, 3500000, 3750000, 4000000, 4500000 /* 30 */ }; const int learn_spell[MAX_STAT + 1] = { @@ -732,7 +732,8 @@ object::update_stats () { float max_speed = 9, added_speed = 0, bonus_speed = 0, speed_reduce_from_disease = 1; - int weapon_weight = 0, weapon_speed = 0; + weight_t weapon_weight = 0; + int weapon_speed = 0; int best_wc = 0, best_ac = 0, wc = 0, ac = 0; int prot[NROFATTACKS], vuln[NROFATTACKS], potion_resist[NROFATTACKS]; object *grace_obj = NULL, *mana_obj = NULL, *tmp; @@ -998,14 +999,14 @@ ac -= tmp->stats.ac + tmp->magic; if (settings.spell_encumbrance == TRUE && type == PLAYER) - contr->encumbrance += 3 * tmp->weight / 1000; + contr->encumbrance += weight_to_kg_approx (3 * tmp->weight); } break; case SHIELD: if (settings.spell_encumbrance == TRUE && type == PLAYER) - contr->encumbrance += tmp->weight / 2000; + contr->encumbrance += weight_to_kg_approx (tmp->weight) >> 1; //FALLTHROUGH case RING: case AMULET: @@ -1049,13 +1050,13 @@ if (type == PLAYER) if (settings.spell_encumbrance) - contr->encumbrance += tmp->weight * 3 / 1000; + contr->encumbrance += weight_to_kg_approx (3 * tmp->weight); break; case ARMOUR: /* Only the best of these three are used: */ if (settings.spell_encumbrance == TRUE && type == PLAYER) - contr->encumbrance += tmp->weight / 1000; + contr->encumbrance += weight_to_kg_approx (tmp->weight); case BRACERS: case FORCE: @@ -1291,9 +1292,9 @@ * weight limit, then player suffers a speed reduction based on how * much above he is, and what is max carry is */ - float f = (carrying / 1000) - max_carry[stats.Str]; + float f = (sint32)weight_to_kg_approx (carrying) - max_carry[stats.Str]; if (f > 0.f) - speed = speed / (1.f + f / max_carry[stats.Str]); + speed /= (1.f + f / max_carry[stats.Str]); } speed += bonus_speed / 10.f; /* Not affected by limits */