[ScryMUD] SVN Commit Info r887 - trunk/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Tue Feb 20 21:48:51 PST 2007


Author: eroper
Date: 2007-02-20 21:48:51 -0800 (Tue, 20 Feb 2007)
New Revision: 887

Modified:
   trunk/mud/grrmud/server/commands.cc
Log:
When placing objects into containers, the weight of the new object is now
considered after applying the target containers percentage_weight.

This is because items that should have been allowed in containers were not
under certain circumstances, such as the container being too full to hold them
prior to applying this modifier. Emptying the container and placing heavy
items into it first was being used as a workaround.


Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc	2007-02-20 09:52:18 UTC (rev 886)
+++ trunk/mud/grrmud/server/commands.cc	2007-02-21 05:48:51 UTC (rev 887)
@@ -4118,9 +4118,15 @@
       return FALSE;
    }
 
-   if ( ( bag.getCurWeight() + vict.getCurWeight() ) > bag.getMaxWeight() ) {
+   //we apply the target containers percentage_weight up front so that the bag
+   // can hold the same things regardless of whether they were put in first or
+   //last.
+   if ( ( bag.getCurWeight() +
+            ( vict.getCurWeight() * ( bag.bag->percentage_weight/100.00 ) )
+        ) > bag.getMaxWeight() ) 
+   {
       Sprintf(buf, cstr(CS_CANT_HOLD_WT, pc),
-              name_of_obj(bag, pc.SEE_BIT), name_of_obj(vict, pc.SEE_BIT));
+            name_of_obj(bag, pc.SEE_BIT), name_of_obj(vict, pc.SEE_BIT));
       show(buf, pc);
       return FALSE;
    }//if




More information about the ScryMUD mailing list