Objs: 48(29)
this is what happened after one of my players logged on an killed one of the mobs about 5 times. first number went up 5 from the blood she created, then 4 for the items she wearing? but if so that only accounts for the 48 and not the 29?
It might be 39 logical objs, but 21 object structure instances. Recall that objects can be grouped together ("stacked").
One thing you can try is just create corpses several times and see if that number goes up incorrectly or varies in some unexpected way. If it does, then you have a problem.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
No i didn't, it was already there. The only thing I dont really know if its working correctly or not is this loaded objs business. In memory i have
IdxObjs: 88 Objs: 39(21)
Me being the only one on this confuses me some what. so theres 21 objects in the world but 39 ob those objs are worn or in another object? or is it 21 in the world that arn't worn or in something, and 39 that are worn and in something?
Well, it's still very hard to say if it would work because we can only partially see the code, so . . . when you run the code, does it do what you expect?
If you want to see if you have leaks, you can run a tool like valgrind, if you have it available on your system.
By the way, did you put in that if (!victim) check in fight.c?
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
the only change to extract_char is that it is now new_extract_char, with the bool for it. then the one if check if its death or not. everything else calls extract_char which then calls new_extrac with false for death, however in fight.c
It's basically impossible for us to say what is going to happen when we don't know what exactly has been changed and we see bits of code here and there. I mean, sure, for the code you posted, it looks like if the variable death is false, every one of the character's objects will be extracted. Whether or not this actually does what you want it to do in the greater scheme of things is a good question. It depends on when 'death' is set to true or false, and what you have changed in other places of the code.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
the changes I made I understand what its doing. Its tacking on an extra arguement, so that you can declare if you died or not. now, in the other copy they use
which will return the bool death, false right, every time extract_char is called. however when new_extract_char is called with the last being TRUE then...
only work on logout, and not on death. Which then stops the memory problem right? but doesn't remove the eq on death correct? Sometimes I seem random sometimes I dont, it usually depends on how tired I am... heh... sorry.
I think you need to slow down a bit and learn what these functions are actually doing, how, and why. I have the impression that you're making changes almost randomly, throwing in lines and seeing what happens. That will only cause trouble further down the line. Take the time to learn a bit before charging ahead, and you will get much more out of the exercise.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
well I just changed extract_char, to the new_extract_char from dbsc copies, adding a bool death at the end, and then adding an if check before the while.
having this in causes everything a player is wearing to be removed, And then only places the inventory in the corpse, but removes all eq worn, removing this however doesn't do it. So either i'm missing something far off or what.
It would really mess up item counts, since the object would basically be floating in space, not in any room, inventory, container, etc. Rare items based on item-count would be affected, for example.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
no that would only extract the objects when a player dies, however when a player quits fPull is true, so that portion would not be run, and its not really an issue of players getting items duplicated, its more the item remain in memory, take a look at your MEMORY command to see how many actual items are loaded in the game, if you do not extract the objects from memory when a player quits, that amount will grow and grow. though truthfully i know not what that would do in the short term, but if your mud is stable and doesn't crash all too often a problem might arise.
doesn't it do what the while does already? so what would be the point of adding it once more? and as of right now I havn't seen any problem with duplicated eq, or even lose of eq after dying or quitting? so many I am just missing something, or that your suggestion already does this for me?
umm no, you do not want to comment that out, move it below the ifcheck, you don't want all those objects remaining when a player quits, they need to be extracted
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.