Page 1 of 1

Mangband server patch required.

Posted: Thu 18.03.2004, 13:23
by Crimson
mangband servers 0.7.2a and earlier require a patch to eliminate a bug in cmd_destroy()..  the patch was submitted by Serge, and is listed below.  

---------------------------
diff -u mangband_0.7.2a/src/server/cmd3.c mangband_0.7.2a.patched/src/server/cmd3.c                                        
--- mangband_0.7.2a/src/server/cmd3.c   Sat Jun 10 18:35:38 2000                                                            
+++ mangband_0.7.2a.patched/src/server/cmd3.c   Sat Mar 13 17:26:35 2004                                                    
@@ -701,6 +701,12 @@                                                                                                        
       if (command_arg > 0) force = TRUE;                                                                                  
                                                                                                                           
                                                                                                                           
+       /* Cannot destroy negative quantities */                                                                            
+       if (quantity <= 0)                                                                                                  
+       {                                                                                                                  
+               return;                                                                                                    
+       }                                                                                                                  
+                                                                                                                          
       /* Get the item (in the pack) */                                                                                    
       if (item >= 0)                                                                                                      
       {                                        
----------------------                                                                          

Re: Mangband server patch required.

Posted: Fri 19.03.2004, 12:48
by Berendol
Anyone using or downloading BMang 6.4.1 through 6.4.3 will have to apply this patch themselves, as I am currently not maintaining my variant. Future versions will have this patch applied whenever I take the project up again.

By the way, wouldn't actually *sending* a negative value require a custom hacked client-of-death? Sigh.. signed values have a way of sneaking into everywhere they shouldn't be.