[ScryMUD] SVN Commit Info r883 - trunk/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Sun Feb 18 14:13:24 PST 2007
Author: eroper
Date: 2007-02-18 14:13:24 -0800 (Sun, 18 Feb 2007)
New Revision: 883
Modified:
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/object.cc
Log:
Bag percentage weights are now properly calculated with floats.
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-02-18 01:11:44 UTC (rev 882)
+++ trunk/mud/grrmud/server/commands.cc 2007-02-18 22:13:24 UTC (rev 883)
@@ -4118,7 +4118,7 @@
return FALSE;
}
- if ((bag.OBJ_CUR_WEIGHT + vict.OBJ_CUR_WEIGHT) > bag.OBJ_MAX_WEIGHT) {
+ if ( ( bag.getCurWeight() + vict.getCurWeight() ) > bag.getMaxWeight() ) {
Sprintf(buf, cstr(CS_CANT_HOLD_WT, pc),
name_of_obj(bag, pc.SEE_BIT), name_of_obj(vict, pc.SEE_BIT));
show(buf, pc);
Modified: trunk/mud/grrmud/server/object.cc
===================================================================
--- trunk/mud/grrmud/server/object.cc 2007-02-18 01:11:44 UTC (rev 882)
+++ trunk/mud/grrmud/server/object.cc 2007-02-18 22:13:24 UTC (rev 883)
@@ -493,7 +493,7 @@
while ((tmp_obj = cll.next())) {
tmp_wt += tmp_obj->getCurWeight();
}//while
- return (tmp_wt * (this->bag->percentage_weight/100)) + extras[5]; // weight of inv, plus container's wt
+ return (tmp_wt * (this->bag->percentage_weight/100.00)) + extras[5]; // weight of inv, plus container's wt
}//else
}//cur_weight
More information about the ScryMUD
mailing list