[CF-Devel] Fix for diseases on tiled maps crashing the server
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Wed Aug 18 02:16:16 CDT 2004
Andreas Kirschbaum wrote:
>
The attached patches fixes a bug with diseases cast on tiled maps. (This
>
bug did crash the server on metalforge some days ago.)
>
>
Basically, the bug is that the loop variables (x and y) in
>
check_infection() are modified by get_map_flags(), resulting in an
>
infinite loop. My fix uses some temp variables for the result values,
>
leaving the loop variables unchanged.
That looks good.
>
>
I checked all other calls of get_map_flags() for similar problems. (I
>
did not actually tested these other fixes.)
Looks like other ones could have similar problems.
>
>
But I have some concerns with the change to magic_wall() in
>
server/spell_effect.c: it does not feel right to me that the existing
>
code used the leftover value from the previous loop for "m". Therefore I
>
added "m=tmp->map" because "x" and "y" use the coordinates from "tmp" as
>
well.
Yes - I think that fix is valid also. I'm not sure how often a problem would
show up - you'd have to cast the spell near the seam of one of the tiled maps,
and without the map being set right, what would probably happen is a wall
showing up someplace odd, but probably far enough from the player they wouldn't
immediately see it. At least in that case, it is unlikely to actually cause a
crash/infinite loop.
So it looks fine to apply the patch.
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list