Mark Wedel wrote: > Andreas Kirschbaum wrote: > > patch-4.diff fixes some invalid array references when no free spot > > can be found. (Only the first one in treasure.c did actually crash.) > > I don't think, the fixes for the exit (and maybe the key) are very > > good because they drop the exit or place the key in an invalid > > place. > > Hard to say - in some cases, it can be better to just crash, because > at least that allows easier investigation on what caused the problem. I did some test-runs with the random_map program. Input file was the attached file "input" with different values for random_seed. The following values cause the function find_first_free_spot() to return -1. treasure.c:178: 1078435692 1078435698 1078435700 1078435712 1078435714 treasure.c:307: 1078439702 1078440272 1078442332 1078442732 1078443081 exit.c:247: (could not find a value to trigger this one) The problem is that the maps contain few free space and large blocked areas. Therefore it is likely that a random position (and the nearby area) is blocked. So the fix for chests (drop them) seems ok to me. For the keys we should try harder (some more tries for keymaster and many tries for ground) and drop the key if we really can't find a free spot. Andreas _______________________________________________ crossfire-devel mailing list crossfire-devel at lists.real-time.com https://mailman.real-time.com/mailman/listinfo/crossfire-devel