Kalle Olavi Niemitalo <k...@iki.fi> writes:

> The upstream patch r9536 does fix the SIGSEGV with duck2.sav.gz
> attached to this bug report.

Here is the upstream patch.

svn log -v -c9536 svn://bos.seul.org/svn/bos/bos/branches/boswars-2.5
svn diff -c9536 svn://bos.seul.org/svn/bos/bos/branches/boswars-2.5

------------------------------------------------------------------------
r9536 | feb | 2008-04-10 22:37:53 +0300 (to, 10 huhti  2008) | 3 lines
Changed paths:
   M /bos/branches/boswars-2.5/CHANGELOG
   M /bos/branches/boswars-2.5/engine/unit/script_unit.cpp
   M /bos/branches/boswars-2.5/engine/unit/unit.cpp

Fixed crash in savegames with destroyed buildings seen by other players   
(Jimmy Salmon)

------------------------------------------------------------------------
Index: CHANGELOG
===================================================================
--- CHANGELOG   (revision 9535)
+++ CHANGELOG   (revision 9536)
@@ -1,6 +1,10 @@
 Change log for Bos Wars
 -----------------------
 
+Version 2.5.1:
+- Fixed crash in savegames with destroyed buildings seen by other players
+(Jimmy Salmon)
+
 Version 2.5.0 (2008 3 1):
 - Free OpenGL textures before changing video mode since not all platforms
 destroy the OpenGL context (Jimmy Salmon)
Index: engine/unit/unit.cpp
===================================================================
--- engine/unit/unit.cpp        (revision 9535)
+++ engine/unit/unit.cpp        (revision 9536)
@@ -867,7 +867,11 @@
        }
        unit->Seen.Type = unit->Type;
        unit->Seen.Constructed = unit->Constructed;
-       unit->Seen.CFrame = unit->Data.Built.Frame;
+       if (unit->Orders[0]->Action == UnitActionBuilt) {
+               unit->Seen.CFrame = unit->Data.Built.Frame;
+       } else {
+               unit->Seen.CFrame = NULL;
+       }
 }
 
 /**
Index: engine/unit/script_unit.cpp
===================================================================
--- engine/unit/script_unit.cpp (revision 9535)
+++ engine/unit/script_unit.cpp (revision 9536)
@@ -612,7 +612,7 @@
                        CConstructionFrame *cframe;
 
                        frame = LuaToNumber(l, j + 1);
-                       cframe = unit->Type->Construction->Frames;
+                       cframe = unit->Seen.Type->Construction->Frames;
                        while (frame--) {
                                cframe = cframe->Next;
                        }

Attachment: pgp1FRbp9g1x0.pgp
Description: PGP signature

Reply via email to