From: <ste...@us...> - 2010-08-17 20:07:53
|
Revision: 1393 http://rails.svn.sourceforge.net/rails/?rev=1393&view=rev Author: stefanfrey Date: 2010-08-17 20:07:46 +0000 (Tue, 17 Aug 2010) Log Message: ----------- Fixed several bugs: - IOException error on reload of rails 1.3 files - IsHome function did not recognize companies with undecided city - BuyTrain toString() was not defined for unlimited trains on reload in ListandFixGames function Modified Paths: -------------- trunk/18xx/rails/game/Game.java trunk/18xx/rails/game/MapHex.java trunk/18xx/rails/game/action/BuyTrain.java Modified: trunk/18xx/rails/game/Game.java =================================================================== --- trunk/18xx/rails/game/Game.java 2010-08-16 19:48:31 UTC (rev 1392) +++ trunk/18xx/rails/game/Game.java 2010-08-17 20:07:46 UTC (rev 1393) @@ -310,8 +310,10 @@ if (object instanceof SortedMap) { ReportBuffer.setCommentItems((SortedMap<Integer, String>) object); } - } catch (EOFException e) { - // continue without comments + } catch (IOException e) { + // continue without comments, if any IOException occurs + // sometimes not only the EOF Exception is raised + // but also the java.io.StreamCorruptedException: invalid type code } } Modified: trunk/18xx/rails/game/MapHex.java =================================================================== --- trunk/18xx/rails/game/MapHex.java 2010-08-16 19:48:31 UTC (rev 1392) +++ trunk/18xx/rails/game/MapHex.java 2010-08-17 20:07:46 UTC (rev 1393) @@ -949,7 +949,7 @@ } public boolean isHomeFor(PublicCompanyI company) { - boolean result = homes != null && homes.get(company) != null; + boolean result = homes != null && homes.containsKey(company); return result; } Modified: trunk/18xx/rails/game/action/BuyTrain.java =================================================================== --- trunk/18xx/rails/game/action/BuyTrain.java 2010-08-16 19:48:31 UTC (rev 1392) +++ trunk/18xx/rails/game/action/BuyTrain.java 2010-08-17 20:07:46 UTC (rev 1393) @@ -209,7 +209,11 @@ StringBuffer b = new StringBuffer(); b.append(company.getName()); - b.append(": buy ").append(getTrain().getName()); + if (train != null) { + b.append(": buy ").append(getTrain().getName()); + } else { + b.append(": buy unlimited train, unique id = ").append(trainUniqueId); + } b.append("-train from ").append(from.getName()); if (fixedCost > 0) { b.append(" for ").append(Bank.format(fixedCost)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |