  | |  | minor do_put bug | minor do_put bug 2004-02-04 - By Martin Vossler
Back I found an interesting bug in do_put...here is an example of a scenario that led me to it:
If a character has (20) of an object that has a weight of 1 each, and tries a 'put all.object container' when the container has a weight of 1 and a value0 (capacity) of 20, then it returns "You are not carrying anything."
I believe its becasue of the following code in do_put (act_obj.c):
if (number <= 1 && str_cmp (arg1, "all") && str_prefix ("all.", arg1)) {
I don't see how this could ever work, because arg1 can't be 'all' AND 'all.item' Anyway, the code falls though to the ELSE statement, and the (20) objects are handled as one...which means that this "object" won't fit. Since there is no check specifically for this, it falls through yet again, and says the character is carrying nothing.
I am using SmaugWiz 2.02, however I check the Smaug1.4a code, and it appears to have the same issue. Correct me if i'm wrong, but I thought i'd bring this issue up.
Leviathan
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1276" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>I found an interesting bug in do_put...here is an example of a scenario that led me to it:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>If a character has (20) of an object that has a weight of 1 each, and </FONT></DIV> <DIV><FONT face=Arial size=2>tries a 'put all.object container' when the container has a weight of 1</FONT></DIV> <DIV><FONT face=Arial size=2>and a value0 (capacity) of 20, then it returns "You are not carrying anything."</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I believe its becasue of the following code in do_put (act_obj.c):</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> if (number <= 1 && str_cmp (arg1, "all") && str_prefix ("all.", arg1)) {</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I don't see how this could ever work, because arg1 can't be 'all' AND 'all.item'</FONT></DIV> <DIV><FONT face=Arial size=2>Anyway, the code falls though to the ELSE statement, and the (20) objects</FONT></DIV> <DIV><FONT face=Arial size=2>are handled as one...which means that this "object " won't fit. Since there is no</FONT></DIV> <DIV><FONT face=Arial size=2>check specifically for this, it falls through yet again, and says the character is </FONT></DIV> <DIV><FONT face=Arial size=2>carrying nothing.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I am using SmaugWiz 2.02, however I check the Smaug1.4a code, and it appears to have the same issue. Correct me if i'm wrong, but I thought i'd bring this issue up.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Leviathan</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
Earn $52 per hosting referral at Lunarpages.
|
|
 |