Re: Shoplift Command Help

From: Thomas Arp (t_arp@mail1.stofanet.dk)
Date: 12/13/00


----- Original Message -----
From: "Alex Mann"
<snip>
>   while ((obj) && (IS_CARRYING_N(ch) < CAN_CARRY_N(ch)) && (bought < buynum)
>          && (IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) <= CAN_CARRY_W(ch))) {
>     bought++;
>     /* Test if producing shop ! */
<snip>

The above only stops if there are no more objects, or if the recipient
cannot carry the object. Since shoplift (as I see it) should only take 1
of any item, you need to get rid of the while() loop and insert an if:


if (obj) {
  bought++;
  /* Test if producing shop ! */
(of course the rest of the code will need a rewrite, too :)

Also - you don't need the 'buynum' var - it's the counter for buying
multiple items.


Welcor of Cruelworld/Builder's Academy

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT