On 5/11/08, Per Inge Mathisen <[EMAIL PROTECTED]> wrote:
> There seems to be a new crash/memory corruption bug somewhere, both in
>  2.1 and trunk now. I currently suspect my r5038 bugfix, but won't be
>  able to look into it more today. It is triggered by loading various
>  savegames multiple times, also seen it when mission done in cam1 first
>  off-world mission.
>
>
>   - Per

I think there are 2 different issues, I loaded back-to-back(x4)
savegame, and it worked OK.  I am not sure what the deal is with that.

For the 1st away mission, this is highly strange, since I traced it
way back to r4126(!).  Verified on both windows & linux.

I could of swore that we checked that revision before on the same 1st
away mission though?

If you revert the changes made in that, then smearing is back, but it
will not crash on the first away mission.

Doing some checking, visibleTiles > MapWidth, and that causes the crash.
Since without the modification in r4126, we get:  visibleTiles.x 44 int &
  visibleTiles.y 64 int.  With it, visibleTiles.x & .y = 64 which is
bigger than the Map of 44.

I also am not sure why the beta test people didn't have this issue,
perhaps this wasn't ported over to 2.1?

Sorry, I don't got time to dig deeper, but maybe the above will help.

Here is a small patch:
Index: src/display3d.c
===================================================================
--- src/display3d.c     (revision 5058)
+++ src/display3d.c     (working copy)
@@ -907,6 +907,10 @@
        Vector3f theSun = { 225.0f, -600.0f, 450.0f };

        setTheSun(theSun);
+       // below 2 lines causes crashes in 1st away mission if commented out
+       // if left in, we get smearing.
+       visibleTiles.x = MIN(VISIBLE_XTILES, mapWidth);
+       visibleTiles.y = MIN(VISIBLE_YTILES, mapHeight);

        // the world centre - used for decaying lighting etc
        gridCentreX = player.p.x + world_coord(visibleTiles.x / 2);

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to