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

scrymud at wanfear.com scrymud at wanfear.com
Fri Jul 23 03:22:45 PDT 2004


Author: eroper
Date: 2004-07-23 03:22:45 -0700 (Fri, 23 Jul 2004)
New Revision: 692

Modified:
   trunk/mud/grrmud/server/critter.cc
Log:
Gold splitting should work correctly now. Previously it would (correctly) only
split with group members that were in your current room. However, it
calculated the gold-per-critter using the total number of group members (even
those not in the room). This caused gold to vanish without a trace.

Also fixed some int/unsigned int gripes during compilation.

Note:
Still need to stop gold-splitting from occurring when you snag gold from a bag
in your inventory.


Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc	2004-07-23 09:35:41 UTC (rev 691)
+++ trunk/mud/grrmud/server/critter.cc	2004-07-23 10:22:45 UTC (rev 692)
@@ -1999,11 +1999,20 @@
    if (d > 0) {
       Cell<critter*> cll(GROUPEES);
       critter* ptr;
-      
+
+      d = 0;
       while ((ptr = cll.next())) {
+         if( ptr->getCurRoomNum() == getCurRoomNum() ) {
+            d++;
+         }
+      };
+
+      GROUPEES.head(cll);
+
+      while ((ptr = cll.prev())) {
          if (ptr->getCurRoomNum() == getCurRoomNum()) {
             ptr->GOLD += amt / d;
-            
+
             if (do_msg) {
                Sprintf(buf, "%S splits %i coins, your share is: %i\n", getName(*ptr), amt, amt/d);
                ptr->show(buf);
@@ -4183,7 +4192,7 @@
    String targ(200);
    // Conversion buf for longs, NOTE: update append() method --Khaav
    String conv_buf(20); 
-   int source_len = PROMPT_STRING.Strlen();
+   unsigned int source_len = PROMPT_STRING.Strlen();
 
    if (! isAFK() ) {
       for (i = 0; i < source_len; ) {
@@ -4308,7 +4317,7 @@
    // Instead of spamming out all the pending commands, be nice about it
    {
       String tmp;
-      int i;
+      unsigned int i;
 
       tmp.Clear();
       for(i=0;i<pc->input.Strlen();i++) {




More information about the ScryMUD mailing list