This makes some major bugs the way it currently is.
It sometimes duplicates the sheath when the MUD is rebooted, also it creates an infinite bug loop stating the weapon has already been released.
I have no clue where to go from here short of throwing my laptop against the wall.
Any help would be appreciated
I don't see the code where it would produce a message saying it was already released.
There are also a few things you should do in the code. You should first check if the argument actually exists, before making it check if the argument is a valid item the player has.
I posted the bug. The weird thing is that the messages go as usual but it's not actually putting the item in it's in_obj even though in the obj_to_obj function it already sets it.
I did that and it stopped the aforementioned bug but it still doesn't actually show in the list of items in the sheath. Also when I try to draw the item I get this bug.
I have the wear location WEAR_SHEATH, the itemtype ITEM_SHEATH, and all the necessary functions. You can also directly put and get items from the sheath as long as they are weapons, and the sheath shows up on the eq list when you type eq as a new item. I also have it set up so it correctly creates the type and wear loc with oset
It's not anymore but I wanna break down why it's not actually placing the weapon inside the sheath. Because obj_to_char actually puts the item in the inventory. I tried a work around with obj_to_char then using equip_char(ch, w_weapon, WEAR_WIELD); but that didn't work either.
I can't figure out for the life of me what is going wrong here. I though it was because I didn't do save_char_obj but that just game me more and more bugs.
I just tested that and it seem to be working so now I just have to work on Draw. The thing I need to fix is that it's checking the wrong thing. It should be doing
OK, I've got it working without GDC. It works fine without bugs but it gives me the get message along with the draw message because I use get_obj() Here is the code:
Yes, obj_from_obj is what you want to be using, not get_obj. Typically a good strategy is to look at how another function is implemented, like the get command, and imitate it; for example, get calls get_obj which then uses obj_from_obj.
Well, I was just curious, because I'd never heard of gdb being specialized for Cygwin, and if it had been, that'd be pretty neat. I couldn't find it in the package list, so I wasn't sure what you were referring to.
That code is pretty neat. One thing you might want to check for is making sure the sheath/scabbard doesn't have something in it already. And if you want multiple things in the sheath, also test to see that things still work if I take a weapon, sheathe it, then take another, sheathe it, and so forth. And also make sure that things don't break if you draw when something is sheathed. And finally, if you have dual-wield, make sure that works as expected too.
Well the entire sheath/draw system was just to test my abilities so I probably won't do anything with dual wield unless I plan on making it a more advanced system. Then again Dual wield is taken from a different iWear so who knows :P.
I am definitely adding a check to see if there is already something in it. Thanks for all the help guys and I might release it if I don't feel lazy and actually get motivated enough to find all the tiny little changes that were required to do the things I wanted it to.
one thing you need to do is make sure they aren't already wielding something when drawing something from their sheath. as it is they will draw it out of the sheath regardless but not have them wield it, in fact i'm not too sure what will happen to the item, just that the player will get mixed messages that they dextrously pulled it or whatever and that they couldn't wield it.