by Chacal » Fri Jul 10, 2009 9:43 am
It's all a question of finding the reverse of an operation. See previous post on this. The reverse of an addobj is not always a delobj, it depends of the type of game file.
For the <file> section, an addobj means adding a file, or replacing a file if it already exists (for example, replacing a prp with a new prp).
Uninstalling that means: if the file existed before, replace the one we put by the old one (that's an addobj). If not, just delete the one we put (that's a delobj).
For the <sdl> section, an addobj means modifying an sdl file (not adding an sdl file):
- find the last version of the statedesc (a block of text)
- copy it
- add or replace (if it existed before) a variable (a line) in it
- increment its version number
- append it at the end of the file.
Uninstalling that is not a delobj, since we never delete versions of statedescs in sdl files. We must add a new version but without the variable we added previously, or with the old value if it existed. So it is in fact an addobj with a different value.
For the <fni> section, an addobj means replacing an old value of a setting with a new value (I don't think we can add new settings, the plasma engine would not know what to do with it).
Uninstalling that means putting back the old value, so it is an addobj with a different value.
For the <age> section, an addobj means adding a new page (a line in the age file), or replacing one if it already exists (for example, if we just want to add a ",1" to force loading a page).
Uninstalling that means putting back the old value if it existed (an addobj with a different value), or deleting the line with our new page, which is a delobj.
So as you see, delobjs don't always make sense.
Chacal
"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi