Other than MAYBE some obscure chipset problem with floating point conversion?
*boggle* This is a first for me, I've never seen anything remotely close
happen....
2 things to possibly try...
1) explicitly typecast the result back to the int form, perhaps it's an
implicit problem
(ie: save = (int)(((victim->level/2) - (level/2)) * 5 -
victim->saving_throw * 1.25); )
2) Mayhaps use a float for the save? not that it would make much of a
difference, but
it should work if nothing else will.... *shrug*
Good luck, that's one heck of a bug
Icechild
Coder of Arthanox
*********** REPLY SEPARATOR ***********
On 12/6/2001 at 4:41 PM Jason Gauthier wrote:
>Anyone want to take a shot in the dark as to why this crashed my mud?
>
>Program terminated with signal 11, Segmentation fault.
>#0 0x80d5440 in saves_spell (level=200, victim=0xbc94450, dam_type=18)
> at magic.c:191
>191 save = ( (victim->level/2) - (level/2)) * 5 -
>victim->saving_throw * 1.25;
>(gdb) list saves_spell
>186 */
>187 bool saves_spell( int level, CHAR_DATA *victim, int dam_type )
>188 {
>189 int save, num;
>190 CLASS *cl;
>191 save = ( (victim->level/2) - (level/2)) * 5 -
>victim->saving_throw * 1.25;
>192
>193 if (IS_AFFECTED(victim,AFF_BERSERK))
>194 save += victim->level/2;
>195
>(gdb) print ( (victim->level/2) - (level/2)) * 5 - victim->saving_throw *
>1.25
>$1 = -453.75
>
>
>
>
>--
>ROM mailing list
>[email protected]
>http://www.rom.org/cgi-bin/mailman/listinfo/rom