The following commit has been merged in the master branch:
commit 8ed1486c5c1fbc0cc3cc3c1548e5516fdb25628f
Author: Ansgar Burchardt <[email protected]>
Date:   Mon Mar 14 20:24:17 2011 +0100

    Add changes upstream decided to add after uploading the first time.

diff --git a/debian/patches/0001-neroden-give-IMG_LEER-type-image_id.patch 
b/debian/patches/0001-neroden-give-IMG_LEER-type-image_id.patch
new file mode 100644
index 0000000..144acbd
--- /dev/null
+++ b/debian/patches/0001-neroden-give-IMG_LEER-type-image_id.patch
@@ -0,0 +1,29 @@
+From f4a563743280adc099efa97ff381a7f473299afb Mon Sep 17 00:00:00 2001
+From: Dwachs <[email protected]>
+Date: Fri, 11 Mar 2011 09:15:57 +0000
+Subject: [PATCH 1/3] (neroden) give IMG_LEER type image_id
+
+git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@4357 
8aca7d54-2c30-db11-9de9-000461428c89
+---
+ simimg.h |    4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/simimg.h b/simimg.h
+index 2b323c7..b5aa25b 100644
+--- a/simimg.h
++++ b/simimg.h
+@@ -15,10 +15,8 @@
+ 
+ #include "simtypes.h"
+ 
+-#define IMG_LEER         0xFFFF
+-
+ typedef uint16 image_id;
+ 
+-// spezielle gebaeude
++#define IMG_LEER ((image_id)0xFFFF)
+ 
+ #endif
+-- 
+1.7.2.3
+
diff --git 
a/debian/patches/0002-FIX-loading-of-savegames-with-line-with-id-0.patch 
b/debian/patches/0002-FIX-loading-of-savegames-with-line-with-id-0.patch
new file mode 100644
index 0000000..e65bca0
--- /dev/null
+++ b/debian/patches/0002-FIX-loading-of-savegames-with-line-with-id-0.patch
@@ -0,0 +1,173 @@
+From 72359f80fb81c039a2f3e14acff11a6056b27a28 Mon Sep 17 00:00:00 2001
+From: Dwachs <[email protected]>
+Date: Fri, 11 Mar 2011 09:16:26 +0000
+Subject: [PATCH 2/3] FIX loading of savegames with line with id=0
+
+git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@4358 
8aca7d54-2c30-db11-9de9-000461428c89
+---
+ simconvoi.cc         |   11 ++++++++---
+ simline.cc           |   14 ++++++++++++--
+ simlinemgmt.cc       |   23 +++++++++++++++++++++--
+ simlinemgmt.h        |    8 ++++++++
+ tpl/quickstone_tpl.h |    5 ++++-
+ 5 files changed, 53 insertions(+), 8 deletions(-)
+
+diff --git a/simconvoi.cc b/simconvoi.cc
+index fa6ddf1..9499a84 100644
+--- a/simconvoi.cc
++++ b/simconvoi.cc
+@@ -353,9 +353,14 @@ DBG_MESSAGE("convoi_t::laden_abschliessen()","state=%s, 
next_stop_index=%d", sta
+                       }
+               }
+ DBG_MESSAGE("convoi_t::laden_abschliessen()","next_stop_index=%d", 
next_stop_index );
+-              if(  line.is_bound()  ) {
+-                      linehandle_t new_line  = line;
+-                      if (  !fpl->matches( welt, line->get_schedule() )  ) {
++
++              linehandle_t new_line  = line;
++              if(  !new_line.is_bound()  ) {
++                      // if there is a line with id=0 in the savegame try to 
assign cnv to this line
++                      new_line = 
get_besitzer()->simlinemgmt.get_line_with_id_zero();
++              }
++              if(  new_line.is_bound()  ) {
++                      if (  !fpl->matches( welt, new_line->get_schedule() )  
) {
+                               // 101 version produced broken line ids => we 
have to find our line the hard way ...
+                               vector_tpl<linehandle_t> lines;
+                               
get_besitzer()->simlinemgmt.get_lines(fpl->get_type(), &lines);
+diff --git a/simline.cc b/simline.cc
+index 1d10047..042e196 100644
+--- a/simline.cc
++++ b/simline.cc
+@@ -49,7 +49,10 @@ simline_t::simline_t(karte_t* welt, spieler_t* sp, linetype 
type, loadsave_t *fi
+       rdwr(file);
+       // now self has the right id but the this-pointer is not assigned to 
the quickstone handle yet
+       // do this explicitly
+-      self = linehandle_t(this, self.get_id());
++      // some savegames have line_id=0, resolve that in laden_abschliessen
++      if (self.get_id()!=0) {
++              self = linehandle_t(this, self.get_id());
++      }
+ }
+ 
+ 
+@@ -85,8 +88,9 @@ void simline_t::create_schedule()
+ 
+ void simline_t::add_convoy(convoihandle_t cnv)
+ {
+-      if (line_managed_convoys.empty()) {
++      if (line_managed_convoys.empty()  &&  self.is_bound()) {
+               // first convoi -> ok, now we can announce this connection to 
the stations
++              // unbound self can happen during loading if this line had 
line_id=0
+               register_stops(fpl);
+       }
+ 
+@@ -225,6 +229,12 @@ void simline_t::rdwr(loadsave_t *file)
+ 
+ void simline_t::laden_abschliessen()
+ {
++      if(  !self.is_bound()  ) {
++              // get correct handle
++              self = sp->simlinemgmt.get_line_with_id_zero();
++              assert( self.get_rep() == this );
++              DBG_MESSAGE("simline_t::laden_abschliessen", "assigned id=%d to 
line %s", self.get_id(), get_name());
++      }
+       if(  line_managed_convoys.get_count()>0  ) {
+               register_stops(fpl);
+       }
+diff --git a/simlinemgmt.cc b/simlinemgmt.cc
+index db8b324..19f61ba 100644
+--- a/simlinemgmt.cc
++++ b/simlinemgmt.cc
+@@ -118,6 +118,9 @@ void simlinemgmt_t::rdwr(karte_t * welt, loadsave_t *file, 
spieler_t *sp)
+               sint32 totalLines = 0;
+               file->rdwr_long(totalLines);
+ DBG_MESSAGE("simlinemgmt_t::rdwr()","number of lines=%i",totalLines);
++
++              simline_t *unbound_line = NULL;
++
+               for (int i = 0; i<totalLines; i++) {
+                       simline_t::linetype lt=simline_t::line;
+                       file->rdwr_enum(lt);
+@@ -126,7 +129,24 @@ DBG_MESSAGE("simlinemgmt_t::rdwr()","number of 
lines=%i",totalLines);
+                                       dbg->fatal( "simlinemgmt_t::rdwr()", 
"Cannot create default line!" );
+                       }
+                       simline_t *line = new simline_t(welt, sp, lt, file);
+-                      add_line( line->get_handle() );
++                      if (!line->get_handle().is_bound()) {
++                              // line id was saved as zero ...
++                              if (unbound_line) {
++                                      dbg->fatal( "simlinemgmt_t::rdwr()", 
"More than one line with unbound id read" );
++                              }
++                              else {
++                                      unbound_line = line;
++                              }
++                      }
++                      else {
++                              add_line( line->get_handle() );
++                      }
++              }
++
++              if (unbound_line) {
++                      // linehandle will be corrected in 
simline_t::laden_abschliessen
++                      line_with_id_zero = linehandle_t(unbound_line);
++                      add_line( line_with_id_zero );
+               }
+       }
+ }
+@@ -156,7 +176,6 @@ void simlinemgmt_t::sort_lines()
+ 
+ void simlinemgmt_t::laden_abschliessen()
+ {
+-      sort_lines();
+       for (vector_tpl<linehandle_t>::const_iterator i = 
all_managed_lines.begin(), end = all_managed_lines.end(); i != end; i++) {
+               (*i)->laden_abschliessen();
+       }
+diff --git a/simlinemgmt.h b/simlinemgmt.h
+index 0fe2aa6..7cdd698 100644
+--- a/simlinemgmt.h
++++ b/simlinemgmt.h
+@@ -79,6 +79,12 @@ public:
+        */
+       linehandle_t create_line(int ltype, spieler_t * sp, schedule_t * fpl);
+ 
++
++      /**
++       * If there was a line with id=0 map it to non-zero handle
++       */
++      linehandle_t get_line_with_id_zero() const {return line_with_id_zero; }
++
+       /*
+        * fill the list with all lines of a certain type
+        * type == simline_t::line will return all lines
+@@ -101,6 +107,8 @@ private:
+       static karte_t * welt;
+ 
+       schedule_list_gui_t *schedule_list_gui;  // Use with caution.  Valid 
only afer zeige_info
++
++      linehandle_t line_with_id_zero;
+ };
+ 
+ #endif
+diff --git a/tpl/quickstone_tpl.h b/tpl/quickstone_tpl.h
+index 57e6c3e..3998f94 100644
+--- a/tpl/quickstone_tpl.h
++++ b/tpl/quickstone_tpl.h
+@@ -138,11 +138,14 @@ public:
+       quickstone_tpl(T* p, uint16 id)
+       {
+               if(p) {
++                      if(  id == 0  ) {
++                              
dbg->fatal("quickstone<T>::quickstone_tpl(T*,uint16)","wants to assign non-null 
pointer to null index");
++                      }
+                       while(  id >= size  ) {
+                               enlarge();
+                       }
+                       if(  data[id]!=NULL  &&  data[id]!=p  ) {
+-                              
dbg->fatal("quickstone<T>::quickstone_tpl(T*,uint16)","slot (%) already taken", 
id);
++                              
dbg->fatal("quickstone<T>::quickstone_tpl(T*,uint16)","slot (%d) already 
taken", id);
+                       }
+                       entry = id;
+                       data[entry] = p;
+-- 
+1.7.2.3
+
diff --git a/debian/patches/0003-Updated-history.txt.patch 
b/debian/patches/0003-Updated-history.txt.patch
new file mode 100644
index 0000000..84741ca
--- /dev/null
+++ b/debian/patches/0003-Updated-history.txt.patch
@@ -0,0 +1,31 @@
+From 299f6f89c909fa5e7fa323da18fc58c027bb9055 Mon Sep 17 00:00:00 2001
+From: Markus Pristovsek <[email protected]>
+Date: Fri, 11 Mar 2011 21:49:27 +0000
+Subject: [PATCH 3/3] Updated history.txt
+
+git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@4359 
8aca7d54-2c30-db11-9de9-000461428c89
+---
+ simutrans/history.txt |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/simutrans/history.txt b/simutrans/history.txt
+index 578c434..eb15668 100644
+--- a/simutrans/history.txt
++++ b/simutrans/history.txt
+@@ -1,4 +1,4 @@
+-Release of 110.0.1 (r4352 on 11-Mar-2011):
++Release of 110.0.1 (r4359 on 12-Mar-2011):
+ 
+       ADD: try to build crossing that match maxspeed of the ways to be crossed
+       ADD: sheep will not walk in cities anymore
+@@ -10,6 +10,7 @@ Release of 110.0.1 (r4352 on 11-Mar-2011):
+       FIX: convois stuck after modifying schedule of line
+       ADD: pak set specific pre-defined player colors and random player colors
+       FIX: world enlargement
++      FIX: loading lines with ID zero again
+ 
+ 
+ Release of 110.0 (r4303 on 14-Feb-2011):
+-- 
+1.7.2.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 6681fb7..3dc04ba 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,6 @@ path-for-game-data.diff
 config.diff
 sha1-replacement.diff
 link-less-libraries.diff
+0001-neroden-give-IMG_LEER-type-image_id.patch
+0002-FIX-loading-of-savegames-with-line-with-id-0.patch
+0003-Updated-history.txt.patch

-- 
transportation simulator

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to