Welcome to the Builder Academy

Question Guild editor like shop edit.

More
08 May 2017 20:50 #6711 by Wpascoe
Does anyone remember a guild editor like the shop editor to create guilds that worked like shops. I am having trouble with mine it crashes as soon as I type gedit and vnum. I dont have the exact line in front of me but its crashing on the line of code that converts the vnum to rnum I remember its gengld line 100. It causing a segmentation fault. Does anyone remember a fix for this. The wierd part is on an old version it works but when I patch it in now it crashes. The code around it looks identical so I am at a lost. I am beginning to think that trying to pick up a mud after a few years for something to do is to much of a headache.. well thanks anyways

Bill

Please Log in or Create an account to join the conversation.

More
09 May 2017 20:51 #6712 by thomas
Replied by thomas on topic Guild editor like shop edit.
Wow - there's a blast from the past. I can see in the comments on the old "circle with goodies" download that I was editing that at some time in the past.

The real_guild() function in gengld.c currently looks like this:
Code:
guild_rnum real_guild(guild_vnum vnum) { guild_rnum bot, top, mid, last_top; if (top_guild < 0) return NOWHERE; bot = 0; top = top_guild; /* perform binary search on guild_table */ for (;;) { last_top = top; mid = (bot + top) / 2; if (GM_NUM(mid) == vnum) return (mid); if (bot >= top) return (NOWHERE); if (GM_NUM(mid) > vnum) top = mid - 1; else bot = mid + 1; if (top > last_top) return NOWHERE; } }

I suggest adding this somewhere above the loop to see what the actual values are:
Code:
log("real_guild() called with argument=%ld, top_guild=%ld", vnum, top_guild);
(you may need to use %d instead of %ld - try both)

Please Log in or Create an account to join the conversation.

More
09 May 2017 22:37 #6714 by Wpascoe
So your code you showed was different than what I had. When I used yours it worked like a champ. Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds