Re: REDIT and IEDIT

From: Levork (fongj@helix.net)
Date: 10/31/95


On Tue, 31 Oct 1995, Billy H. Chan (~{3B:FH;~}) wrote:

> In defense for the OLC that was at the ftp site, I THOUGHT I MADE IT
> CLEAR when I tried to use it that a few things WERE buggy and that
> people should use room stubs and object stubs when playing around...

<snip>

Well, I *did* write the thing. Seeing the amount of mail going back and
forth over the olc, I felt I had better get out of the woodwork. First
off, I had posted a message that I was going to post a newer version
including medit. I've changed my mind, partly because of the various death
threat-type e-mail that I received (your olc screwed up my objects!  I
lost all my rooms! You should be killed! etc etc.) I thought I had made it
clear in the readme file to back up your objects, as well as the fact that
this was preliminary code, but I guess some didn't read that. Seeing as
there might be more problems still with string corruption in medit I don't
want to go through that again. 

I also honestly can't find the time to unpatch the olc code from the mud 
I'm working on, because my coding style is VERY bad, and I basically 
hacked together changes to it. And I don't really want to expose my 
lousy coding style to the world. =)

Anyways, at least I should describe what's corrupting objects. I can't
remember exactly how far my patch went. But I do know the problem is that
every single object in the world must be renumbered correctly. The string
corruption occurs when objects are purged in extract_object (some function
like that). To illustrate, say I add a new object 1. Let's say object 2
already exists (say it's a long sword). If some sap in the game has object
2, its rnum must be shifted up one in obj_index, because otherwise when
the sap eats his sword and destroys it, extract_object will free all the
strings associated with the sword, but these strings are shared between
all long swords in the game!  Extract object compares the strings against
obj_proto[1] NOT obj_proto[2] as it should be comparing, and thus frees
the strings. The solution is to just increment all object rnums by 1
whenever you insert a new object. (All objects with vnums higher than this
particular object, that is). 

To solve zone reset problems, you also have to mess around with the zone 
table commands and renumber every single object that's in there, as 
object vnums are resolved to rnums at game bootup time. More hacking 
involved here.

I'm very sorry about the lousy code that I released - if anyone has any 
problems with fixing it as described above, please reply and I'll try to 
help as I can.

Levork
mars.galstar.com 3000



This archive was generated by hypermail 2b30 : 12/07/00 PST