Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Obj already extracted?

Obj already extracted?

Posting of new messages is disabled at present.

Refresh page


Posted by Dace K   Canada  (169 posts)  Bio
Date Sun 19 Mar 2006 08:44 AM (UTC)
Message
I've added a check in one function to take an object automatically from a players's container worn in a certain location if it's there.


separate_obj(ammo);
get_obj( ch, ammo, container, FALSE );


So far, so good. The line after that, though,
equip_char( ch, ammo, WEAR_HOLD );

keeps returning the error message (Log: [*****] BUG: equip_char: obj not being carried by ch!) if the char already had an identical item to the one he's getting from the container.

Further down, the object is extracted, but again an error message pops up, this time reading: Log: [*****] BUG: extract_obj: obj 107 already extracted!

This works fine, however, when there is no duplicates of this item in the char's inventory.

Any ideas?

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Sun 19 Mar 2006 10:09 AM (UTC)
Message
The problem, I think, is that get_obj calls obj_to_char which will group the object into the player's inventory. Once the object is grouped, it might destroy the object 'ammo' because it grouped it with the identical copy. So, equip_char will fail to find the object in the char's inventory, and extract_obj will be unhappy because the object is already scheduled for extraction.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #2 on Sun 19 Mar 2006 11:09 PM (UTC)
Message
Ah, I see. Easy fix then, thanks.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,179 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.