Hello time to pick your wonderful brains again...
I've written a bit of code that basically determines how powerful a clan is by compiling some information together and doing some simple math - I had it working but for some reason, it just stopped. It crashes every time it calls to the function - here's the dead line...
Program received signal SIGSEGV, Segmentation fault.
0x00000000004b2f9a in update_flipower (ch=0x105ca40) at fli.c:686
686 mbrs += ch->pcdata->clan->members;
(gdb) bt
#0 0x00000000004b2f9a in update_flipower (ch=0x105ca40) at fli.c:686
#1 0x0000000000409880 in do_save (ch=0x105ca40, argument=0x7fffffffe1b2 "") at act_comm.c:2462
#2 0x00000000004cced5 in interpret (ch=0x105ca40, argument=0x7fffffffe1b2 "") at interp.c:740
#3 0x00000000004406b8 in do_force (ch=0x102da80, argument=0x7fffffffe1ae "save") at act_wiz.c:6280
#4 0x00000000004cced5 in interpret (ch=0x102da80, argument=0x7fffffffe1a6 "belerik save") at interp.c:740
#5 0x000000000047fe11 in game_loop () at comm.c:684
#6 0x000000000047f2e0 in main (argc=1, argv=0x7fffffffe768) at comm.c:331
here's the entire function
I've written a bit of code that basically determines how powerful a clan is by compiling some information together and doing some simple math - I had it working but for some reason, it just stopped. It crashes every time it calls to the function - here's the dead line...
Program received signal SIGSEGV, Segmentation fault.
0x00000000004b2f9a in update_flipower (ch=0x105ca40) at fli.c:686
686 mbrs += ch->pcdata->clan->members;
(gdb) bt
#0 0x00000000004b2f9a in update_flipower (ch=0x105ca40) at fli.c:686
#1 0x0000000000409880 in do_save (ch=0x105ca40, argument=0x7fffffffe1b2 "") at act_comm.c:2462
#2 0x00000000004cced5 in interpret (ch=0x105ca40, argument=0x7fffffffe1b2 "") at interp.c:740
#3 0x00000000004406b8 in do_force (ch=0x102da80, argument=0x7fffffffe1ae "save") at act_wiz.c:6280
#4 0x00000000004cced5 in interpret (ch=0x102da80, argument=0x7fffffffe1a6 "belerik save") at interp.c:740
#5 0x000000000047fe11 in game_loop () at comm.c:684
#6 0x000000000047f2e0 in main (argc=1, argv=0x7fffffffe768) at comm.c:331
here's the entire function
void update_flipower( CHAR_DATA *ch )
{
int flipower = 0;
int mbrs = 0;
// check to see if they're retired and terminate if so
if ((ch->level == 55 || ch->level == 57) && IS_RETIRED(ch))
{
return;
}
if ((ch->level == 55 || ch->level == 57) && !IS_RETIRED(ch))
{
mbrs += ch->pcdata->clan->members;
//flipower += ch->pcdata->clan->members * 2;
flipower += mbrs * 2;
// max out member points at 100
if (flipower > 100)
{
flipower = 100;
}
flipower += ch->pcdata->clan->balance / 7500;
if (flipower > 200)
{
flipower = 200;
}
if (ch->level == 57)
{
flipower += 50;
}
ch->pcdata->clan->powerlvl += flipower;
return;
}
return;
}