Mangband server patch required.

General discussion about the game. Pull up a stool and tell us your tale!
Post Reply
Crimson
King Lich
Posts: 315
Joined: Sat 26.10.2002, 15:00
Location: Mangband Project Team Member
Contact:

Mangband server patch required.

Post by Crimson » Thu 18.03.2004, 13:23

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)                                                                                                      
       {                                        
----------------------                                                                          
Are you not entertained?
Is this not what you came here for?

-- Maximus Decimus Meridias, The Gladiator

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Mangband server patch required.

Post by Berendol » Fri 19.03.2004, 12:48

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.
By appreciation, we make excellence in others our own property. (Voltaire)

Post Reply