PenUltima Online

It is currently Sat Aug 30, 2008 7:02 am

All times are UTC - 8 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: FindSubstance bug when reserve = 1 ?
PostPosted: Sun May 14, 2006 8:22 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 745
Location: Chicago, IL USA
When you use FindSubstance and set the reserve to 1, it doesnt allow you to use SubtractAmount or ConsumeSubstance on an item thats reserved. Also, if you use FindSubstance on an item thats already been reserved by FindSubstance, it will return an error that it didnt find anything (dont know if maybe that last problem was intentional or not). A snippet of the code I'm using is below...

Code:
 
  var material := FindSubstance(who.backpack, thematerial, amt, 1);
  SendSysMessage(who, CStr(material));
  if ( !material )
    SendSysMessage(who, "You dont have enough resources to fix that item.");
    return;
  endif
  if (!ConsumeSubstance(who.backpack, thematerial, amt))
    SendSysMessage(who, "Unable to consume the resources to fix that item.");
    return;
  endif


First, this gives the sysmessage "Unable to consume the resources to fix that item" (Because SubtractAmount/ConsumeSubstance fails)

next time through, it will say "Error: Not enough of that substance in container." and "You dont have enough resources to fix that item."

Now if I do this

Code:
  var material := FindSubstance(who.backpack, thematerial, amt, 0);
  ReserveItem(material);

ConsumeSubstance will work and FindSubstance will continue returning it even if reserved but SubtractAmount still doesnt work.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl