Now i've been posting a lot in this forum the last few months. The only probs i bring up here is ones i can't figure out after trying for at least a day. Now most errors in gdb seem to be segmentation fault or something like that. But this one is new.
Program received signal SIGFPE, Arithmetic exception.
0x00499216 in new_saves_spell (ch=0xdbed88, victim=0xdbed88, dam_type=9)
at magic.c:229
229 save = ( (vic_save * 100) / (ch_save + vic_save) );
The problem occurs when, as a mortal i try to cast curse on myself (some people might try that) and it crashes the mud. In gdb it gives the above error "arithmetic exception". I've re-arranged the formula, checked the values of vic_save, ch_save, ch, victim, and its all done correctly... I just don't get why this error would come up. I've even made the values into variable then did the division, still the same prob.
Backtrace shows this:
(gdb) bt
#0 0x00499216 in new_saves_spell (ch=0xdbed88, victim=0xdbed88, dam_type=9)
at magic.c:229
#1 0x0049deb5 in spell_curse (sn=60, level=129, ch=0xdbed88, vo=0xdbed88,
target=0) at magic.c:1922
#2 0x0049a7e1 in do_cast (ch=0xdbed88, argument=0xdbe0a2 "curse self")
at magic.c:780
#3 0x00497c8c in interpret (ch=0xdbed88, argument=0xdbe09d "cast curse self")
at interp.c:669
#4 0x0044144c in substitute_alias (d=0xdbd720,
argument=0xdbe09d "cast curse self") at alias.c:107
#5 0x00449bdb in game_loop_unix (control=4, wwwcontrol=5) at comm.c:905
#6 0x00449478 in main (argc=1, argv=0xb113b0) at comm.c:472
Program received signal SIGFPE, Arithmetic exception.
0x00499216 in new_saves_spell (ch=0xdbed88, victim=0xdbed88, dam_type=9)
at magic.c:229
229 save = ( (vic_save * 100) / (ch_save + vic_save) );
The problem occurs when, as a mortal i try to cast curse on myself (some people might try that) and it crashes the mud. In gdb it gives the above error "arithmetic exception". I've re-arranged the formula, checked the values of vic_save, ch_save, ch, victim, and its all done correctly... I just don't get why this error would come up. I've even made the values into variable then did the division, still the same prob.
Backtrace shows this:
(gdb) bt
#0 0x00499216 in new_saves_spell (ch=0xdbed88, victim=0xdbed88, dam_type=9)
at magic.c:229
#1 0x0049deb5 in spell_curse (sn=60, level=129, ch=0xdbed88, vo=0xdbed88,
target=0) at magic.c:1922
#2 0x0049a7e1 in do_cast (ch=0xdbed88, argument=0xdbe0a2 "curse self")
at magic.c:780
#3 0x00497c8c in interpret (ch=0xdbed88, argument=0xdbe09d "cast curse self")
at interp.c:669
#4 0x0044144c in substitute_alias (d=0xdbd720,
argument=0xdbe09d "cast curse self") at alias.c:107
#5 0x00449bdb in game_loop_unix (control=4, wwwcontrol=5) at comm.c:905
#6 0x00449478 in main (argc=1, argv=0xb113b0) at comm.c:472