Bug: Nested put resets do not work properly when reset_area fires.
Danger: Low - Items resetting in wrong locations
Found by: Samson
Fixed by: Samson
Note: This fix raises the Smaug FUSS package to version 1.6 to distinguish the area file format changes this makes.
This is a relatively involved fix. Please download the "SMAUG Reset system fix" file from the downloads section at http://www.smaugmuds.org
Discussion of the problem is welcome in the SMAUG 1.6 FUSS forum.
Nested put resets in Smaug have had a notorious history for not working correctly.
In stock form, the code is incapable of generating them properly using the OLC,
incapable of processing them properly when area files are loaded, and incapable of
loading items properly according to how resets are defined in the file even if the
file is manually edited.
Part of this was corrected with a previous bugfix which allowed the OLC to generate
the proper resets which will then save correctly into the area files. These resets
load to the area in the proper order but the nested puts still did not perform as
An example of the issue:
Load a chest into a room.
Load a bag into the chest.
Load a pouch into the bag.
Load a trinket into the pouch.
The expected result would of course be to have to dig through all that to get the trinket
out of the chest, but what really happens is that it all just loads as contents of the chest.
This problem has existed at least as far back as Smaug 1.4a and therefore affects practically
all codebases derived from it. I have confirmed that this problem exists on Smaug FUSS, as well
as ResortMUD and the public AFKMud code, so in all likelyhood all Smaug derivatives are affected.
In order to fix this problem, I decided it would be best to disassociate resets with an overall
area and instead focus them on individual rooms, which are then associated with an area so
that normal whole area resetting can still take place. Of course this required alot of reworking
of how the entire system works. But the end result is that the example above will perform properly
and all objects assigned to put resets will load exactly as intended.
Areas now have a list of rooms.
Rooms now have a list of resets that should take place in them.
Object and Mobile resets now have child resets which belong to them.
There is one caveat to be aware of though. Area files may have invalid data still in them and once
the fix is applied they may produce unexpected results, such as swords loading inside of shoes, etc.
Affected area files will need to be fixed by hand, so you will need a working knowledge of how
they are formatted. Trap and Hide resets will also not be convertable because the code has no
confirmed way to know where they should be placed. These will also need to be hand corrected.
There may also be items and mobs loading into unexpected rooms. Some functionality of the
manual reset editing has also been removed for now. Best to scale back and rebuild rather than keep
kludgy code that would only need to be rewritten anyway. If this functionality is desired, it
can be added back in easily enough.
Once all that is corrected though, the reset system will hum along quite nicely.