Menu

#1 Patch for Lgeneral 1.2.3 seg. fault bug

Unstable_(example)
closed
nobody
None
5
2015-09-13
2012-06-04
Galland
No

Segmentation fault that crashes the game on the AI "MOVE & ATTACK" phase.

Bug Reason:
In function "unit_get_damage" of unit.c, this line was causing the seg.fault:
if ( unit->terrain->flags[cur_weather] & SWAMP )

the reason is the flags pointer was missing. It seems a certain unit did not have the terrain set. From analyzing where terrain is written, I see it is not set when loading a savegame.

Bug Fix:
In function "load_unit" of slot.c I have added the following at line 609:
unit->terrain = map[unit->x][unit->y].terrain;

In this way the units always get the terrain filled upon loading a game, which was causing the above problem.

Patch attached and licensed as GPL.

Discussion

  • Galland

    Galland - 2012-06-04

    Patch for Lgeneral 1.2.3 seg. fault bug

     
  • Michael Speck

    Michael Speck - 2015-09-13

    three years later... sorry I just read this now. applied it, thanks!

     
  • Michael Speck

    Michael Speck - 2015-09-13
    • status: open --> closed
    • Group: --> Unstable_(example)
     

Log in to post a comment.