Hi,
After endless days of agony, and thoughts of basing my mud on ACK!
(sounded like the right mud base to start with *grin*), I found out what
was causing my famous (?) memory corruption, that caused medit/free to
crash. Fixing the problem still leaves me with one question. Could someone
please look at the below two snippets, one called BEFORE and one called
AFTER (AFTER == NOW ,-) and tell me why the memory was corrupted before,
but not after the change I made in assign_the_shopkeepers ?
If you want to know, the reason I changed it in the first place is, that
I'm saving the spec_proc name if one is assigned in the pfiles, much like
the patch I beleave there's been made available on the ftp site(s) - ain't
the same code though *g*
------- BEFORE -------
void assign_the_shopkeepers(void)
{
int index;
cmd_say = find_command("say");
cmd_tell = find_command("tell");
cmd_emote = find_command("emote");
cmd_slap = find_command("slap");
cmd_puke = find_command("puke");
for (index = 0; index < top_shop; index++) {
/* Fix problem with the shop_keeper spec-proc also being assigned from
* the mob files with the 'SpecialProc: shop_keeper' command.
* If the shop_keeper proc is already assigned, skip this one.
*/
if (mob_index[SHOP_KEEPER(index)].func &&
mob_index[SHOP_KEEPER(index)].func == *shop_keeper)
continue;
if (mob_index[SHOP_KEEPER(index)].func)
SHOP_FUNC(index) = mob_index[SHOP_KEEPER(index)].func;
mob_index[SHOP_KEEPER(index)].func = shop_keeper;
}
}
------- END BEFORE -------
This is what I changed the for() loop to:
-------- AFTER --------
for (index = 0; index < top_shop; index++) {
/* Fix problem with the shop_keeper spec-proc also being assigned from
* the mob files with the 'SpecialProc: shop_keeper' command.
* If the shop_keeper proc is already assigned, skip this one.
*/
if ((SHOP_KEEPER(index) > -1) && (SHOP_KEEPER(index) <= top_of_mobt)) {
if (mob_index[SHOP_KEEPER(index)].func &&
mob_index[SHOP_KEEPER(index)].func == shop_keeper) {
/* Don't do a thing! */
}
else {
if (mob_index[SHOP_KEEPER(index)].func)
SHOP_FUNC(index) = mob_index[SHOP_KEEPER(index)].func;
mob_index[SHOP_KEEPER(index)].func = shop_keeper;
}
}
}
-------- END AFTER -------
Regards,
Rand
.d
--
Rasmus Ronlev DOEK'94 http://www.econ.cbs.dk/~raro94ab
IT-Advisor mailto:raro94ab@student.econ.cbs.dk
B.Sc. Computer Science and Business Administration
Stud. M.Sc. Computer Science and Business Administration
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST