[CF-Devel] Python/casino stuff

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Fri Oct 24 02:23:55 CDT 2003


>
     
       It'd be really help to post a plugin snippet that exhibits the bug.
     
     
Actually it's easy to show (my apologies for not giving enough details 
once again *writes down 'give enough details next time').
Start server, goto Goth's tavern, to the casino machine.
Drop some gold coins, and play until you get some gain.
Notice the gold coin #, you'll see it's incoherent
(you drop 50 coins, play machine, gain some, and there are only 5 on the 
ground, for instance)

>
     
       IF what your doing is doing is calling the function to create the 
     
     >
     
      object, and then the function to set the nrof, then the behaviour above 
     
     >
     
      is correct.  The setquantity has no idea of past object state, so thus 
     
     >
     
      doesn't know if it should set the value absolute or add to it.
     
     >
     
     
     >
     
       The correct method then in the script would be to call getquanity on 
     
     >
     
      the item, and then add onto that.
     
     
I think the bug is that createobject, as used in the script, is assumed 
to return a newly created object with nrof == 1. Thus using setquantity 
is ok.
Which works most of the time, but not when there is already some objects 
like the one being created (they get merged, thus nrof != 1)

Nicolas 'Ryo'


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list