Loading

Revision differences

Old revision #pslxvnpmwNew revision #phckb7exn
1Index: projects/generate_vs100.vcxproj    
2===================================================================    
3--- projects/generate_vs100.vcxproj    (revision 27153)    
4+++ projects/generate_vs100.vcxproj    (working copy)    
5@@ -1,5 +1,5 @@    
6-<?xml version="1.0" encoding="utf-8"?>    
7-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
8+<?xml version="1.0" encoding="utf-8"?>    
9+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
10   <ItemGroup Label="ProjectConfigurations">    
11     <ProjectConfiguration Include="Debug|Win32">    
12       <Configuration>Debug</Configuration>    
13@@ -14,6 +14,7 @@    
14   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />    
15   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">    
16     <ConfigurationType>Utility</ConfigurationType>    
17+    <PlatformToolset>v120</PlatformToolset>    
18   </PropertyGroup>    
19   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />    
20   <ImportGroup Label="ExtensionSettings">    
21@@ -39,4 +40,4 @@    
22   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />    
23   <ImportGroup Label="ExtensionTargets">    
24   </ImportGroup>    
25-</Project>    
26+</Project>    
27\ No newline at end of file    
28Index: projects/langs_vs100.vcxproj    
29===================================================================    
30--- projects/langs_vs100.vcxproj    (revision 27153)    
31+++ projects/langs_vs100.vcxproj    (working copy)    
32@@ -1,5 +1,5 @@    
33-<?xml version="1.0" encoding="utf-8"?>    
34-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
35+<?xml version="1.0" encoding="utf-8"?>    
36+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
37   <ItemGroup Label="ProjectConfigurations">    
38     <ProjectConfiguration Include="Debug|Win32">    
39       <Configuration>Debug</Configuration>    
40@@ -16,6 +16,7 @@    
41   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">    
42     <ConfigurationType>Utility</ConfigurationType>    
43     <UseOfMfc>false</UseOfMfc>    
44+    <PlatformToolset>v120</PlatformToolset>    
45   </PropertyGroup>    
46   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />    
47   <ImportGroup Label="ExtensionSettings">    
48@@ -381,4 +382,4 @@    
49   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />    
50   <ImportGroup Label="ExtensionTargets">    
51   </ImportGroup>    
52-</Project>    
53+</Project>    
54\ No newline at end of file    
55Index: projects/openttd_vs100.sln    
56===================================================================    
57--- projects/openttd_vs100.sln    (revision 27153)    
58+++ projects/openttd_vs100.sln    (working copy)    
59@@ -1,5 +1,7 @@    
60-Microsoft Visual Studio Solution File, Format Version 11.00    
61-# Visual C++ Express 2010    
62+Microsoft Visual Studio Solution File, Format Version 12.00    
63+# Visual Studio Express 2013 for Windows Desktop    
64+VisualStudioVersion = 12.0.31101.0    
65+MinimumVisualStudioVersion = 10.0.40219.1    
66 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openttd", "openttd_vs100.vcxproj", "{668328A0-B40E-4CDB-BD72-D0064424414A}"    
67     ProjectSection(ProjectDependencies) = postProject    
68         {0817F629-589E-4A3B-B81A-8647BC571E35} = {0817F629-589E-4A3B-B81A-8647BC571E35}    
69@@ -29,14 +31,15 @@    
70         Release|x64 = Release|x64    
71     EndGlobalSection    
72     GlobalSection(ProjectConfigurationPlatforms) = postSolution    
73-        {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.ActiveCfg = Debug|Win32    
74-        {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.Build.0 = Debug|Win32    
75+        {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.ActiveCfg = Release|x64    
76+        {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|Win32.Build.0 = Release|x64    
77         {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|x64.ActiveCfg = Debug|x64    
78         {668328A0-B40E-4CDB-BD72-D0064424414A}.Debug|x64.Build.0 = Debug|x64    
79         {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|Win32.ActiveCfg = Release|Win32    
80         {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|Win32.Build.0 = Release|Win32    
81-        {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.ActiveCfg = Release|x64    
82-        {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.Build.0 = Release|x64    
83+        {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.ActiveCfg = Release|Win32    
84+        {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.Build.0 = Release|Win32    
85+        {668328A0-B40E-4CDB-BD72-D0064424414A}.Release|x64.Deploy.0 = Release|Win32    
86         {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|Win32.ActiveCfg = Debug|Win32    
87         {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|Win32.Build.0 = Debug|Win32    
88         {A133A442-BD0A-4ADE-B117-AD7545E4BDD1}.Debug|x64.ActiveCfg = Debug|Win32    
89Index: projects/openttd_vs100.vcxproj    
90===================================================================    
91--- projects/openttd_vs100.vcxproj    (revision 27153)    
92+++ projects/openttd_vs100.vcxproj    (working copy)    
93@@ -1,5 +1,5 @@    
94-<?xml version="1.0" encoding="utf-8"?>    
95-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
96+<?xml version="1.0" encoding="utf-8"?>    
97+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
98   <ItemGroup Label="ProjectConfigurations">    
99     <ProjectConfiguration Include="Debug|Win32">    
100       <Configuration>Debug</Configuration>    
101@@ -28,6 +28,7 @@    
102     <ConfigurationType>Application</ConfigurationType>    
103     <UseOfMfc>false</UseOfMfc>    
104     <CharacterSet>Unicode</CharacterSet>    
105+    <PlatformToolset>v120</PlatformToolset>    
106   </PropertyGroup>    
107   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">    
108     <ConfigurationType>Application</ConfigurationType>    
109@@ -34,11 +35,13 @@    
110     <UseOfMfc>false</UseOfMfc>    
111     <CharacterSet>Unicode</CharacterSet>    
112     <WholeProgramOptimization>true</WholeProgramOptimization>    
113+    <PlatformToolset>v120</PlatformToolset>    
114   </PropertyGroup>    
115   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">    
116     <ConfigurationType>Application</ConfigurationType>    
117     <UseOfMfc>false</UseOfMfc>    
118     <CharacterSet>Unicode</CharacterSet>    
119+    <PlatformToolset>v120</PlatformToolset>    
120   </PropertyGroup>    
121   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">    
122     <ConfigurationType>Application</ConfigurationType>    
123@@ -45,6 +48,7 @@    
124     <UseOfMfc>false</UseOfMfc>    
125     <CharacterSet>Unicode</CharacterSet>    
126     <WholeProgramOptimization>true</WholeProgramOptimization>    
127+    <PlatformToolset>v120</PlatformToolset>    
128   </PropertyGroup>    
129   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />    
130   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">    
131@@ -88,6 +92,10 @@    
132     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\objs\$(Platform)\$(Configuration)\</OutDir>    
133     <LocalDebuggerWorkingDirectory>$(ProjectDir)..\bin</LocalDebuggerWorkingDirectory>    
134   </PropertyGroup>    
135+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">    
136+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\OpenTTD\OpenTTD essentials\shared\include;</IncludePath>    
137+    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);C:\OpenTTD\OpenTTD essentials\win32\library;</LibraryPath>    
138+  </PropertyGroup>    
139   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">    
140     <Midl>    
141       <TypeLibraryName>.\Release/openttd.tlb</TypeLibraryName>    
142@@ -144,6 +152,7 @@    
143       </DataExecutionPrevention>    
144       <TargetMachine>MachineX86</TargetMachine>    
145       <EnableCOMDATFolding>true</EnableCOMDATFolding>    
146+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>    
147     </Link>    
148   </ItemDefinitionGroup>    
149   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">    
150@@ -1290,4 +1299,4 @@    
151     </ProjectReference>    
152   </ItemGroup>    
153   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />    
154-</Project>    
155+</Project>    
156\ No newline at end of file    
157Index: projects/settingsgen_vs100.vcxproj    
158===================================================================    
159--- projects/settingsgen_vs100.vcxproj    (revision 27153)    
160+++ projects/settingsgen_vs100.vcxproj    (working copy)    
161@@ -1,5 +1,5 @@    
162 <?xml version="1.0" encoding="utf-8"?>    
163-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
164+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
165   <ItemGroup Label="ProjectConfigurations">    
166     <ProjectConfiguration Include="Debug|Win32">    
167       <Configuration>Debug</Configuration>    
168@@ -15,6 +15,7 @@    
169   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">    
170     <ConfigurationType>Application</ConfigurationType>    
171     <CharacterSet>MultiByte</CharacterSet>    
172+    <PlatformToolset>v120</PlatformToolset>    
173   </PropertyGroup>    
174   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />    
175   <ImportGroup Label="ExtensionSettings">    
176Index: projects/strgen_vs100.vcxproj    
177===================================================================    
178--- projects/strgen_vs100.vcxproj    (revision 27153)    
179+++ projects/strgen_vs100.vcxproj    (working copy)    
180@@ -1,5 +1,5 @@    
181-<?xml version="1.0" encoding="utf-8"?>    
182-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
183+<?xml version="1.0" encoding="utf-8"?>    
184+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
185   <ItemGroup Label="ProjectConfigurations">    
186     <ProjectConfiguration Include="Debug|Win32">    
187       <Configuration>Debug</Configuration>    
188@@ -16,6 +16,7 @@    
189     <ConfigurationType>Application</ConfigurationType>    
190     <UseOfMfc>false</UseOfMfc>    
191     <CharacterSet>MultiByte</CharacterSet>    
192+    <PlatformToolset>v120</PlatformToolset>    
193   </PropertyGroup>    
194   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />    
195   <ImportGroup Label="ExtensionSettings">    
196@@ -91,4 +92,4 @@    
197   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />    
198   <ImportGroup Label="ExtensionTargets">    
199   </ImportGroup>    
200-</Project>    
201+</Project>    
202\ No newline at end of file    
203Index: src/saveload/company_sl.cpp  1Index: src/saveload/company_sl.cpp  
204===================================================================  2===================================================================  
205--- src/saveload/company_sl.cpp    (revision 27153)  3--- src/saveload/company_sl.cpp    (revision 27153)  
206+++ src/saveload/company_sl.cpp    (working copy)  4+++ src/saveload/company_sl.cpp    (working copy)  
207@@ -180,6 +180,9 @@  5@@ -179,8 +179,11 @@
   6                         if (IsShipDepot(tile)) c->infrastructure.water += LOCK_DEPOT_TILE_FACTOR;
208                         if (IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE) {  7                         if (IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE) {  
209                             /* The middle tile specifies the owner of the lock. */  8                             /* The middle tile specifies the owner of the lock. */  
210                             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // the middle tile specifies the owner of the  9-                            c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // the middle tile specifies the owner of the
211+                            if (GetWaterClass(tile) != WATER_CLASS_CANAL) {  10-                            break; // do not count the middle tile as canal
212+                                c->infrastructure.water++;  11+                            c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR;
213+                            }  12+
214                             break; // do not count the middle tile as canal  13+                            /* Only count the middle tile as canal if the tile is not river. */
   14+                            if (GetWaterClass(tile) != WATER_CLASS_RIVER) c->infrastructure.water++;
   15+                            break;
215                         }  16                         }  
216                     }  17                     }  
  18                 }  
217Index: src/water_cmd.cpp  19Index: src/water_cmd.cpp  
218===================================================================  20===================================================================  
219--- src/water_cmd.cpp    (revision 27153)  21--- src/water_cmd.cpp    (revision 27153)  
220+++ src/water_cmd.cpp    (working copy)  22+++ src/water_cmd.cpp    (working copy)  
221@@ -258,10 +258,14 @@  221@@ -258,9 +258,14 @@
222   24   
223     /* middle tile */  25     /* middle tile */  
224     WaterClass wc_middle = IsWaterTile(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL;  26     WaterClass wc_middle = IsWaterTile(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL;  
225-    ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);  27-    ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);  
226-    if (ret.Failed()) return ret;  28-    if (ret.Failed()) return ret;  
227-    cost.AddCost(ret);  29-    cost.AddCost(ret);  
228  228+       
229+    if (!IsWaterTile(tile)) {  31+    if (!IsWaterTile(tile)) {  
230+        ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);  32+        ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);  
231+        if (ret.Failed()) return ret;  33+        if (ret.Failed()) return ret;  
232+        cost.AddCost(ret);  34+        cost.AddCost(ret);  
  35+        /* Add an extra cost only if not building on a river. */  
233+        cost.AddCost(_price[PR_BUILD_CANAL]);  36+        cost.AddCost(_price[PR_BUILD_CANAL]);  
234+    }  37+    }  
235+  235
236     /* lower tile */  39     /* lower tile */  
237     WaterClass wc_lower = IsWaterTile(tile - delta) ? GetWaterClass(tile - delta) : WATER_CLASS_CANAL;  40     WaterClass wc_lower = IsWaterTile(tile - delta) ? GetWaterClass(tile - delta) : WATER_CLASS_CANAL;  
238   238@@ -298,6 +303,7 @@
239@@ -298,6 +302,7 @@    
240         if (c != NULL) {  42         if (c != NULL) {  
241             /* Counts for the water. */  43             /* Counts for the water. */  
242             if (!IsWaterTile(tile - delta)) c->infrastructure.water++;  44             if (!IsWaterTile(tile - delta)) c->infrastructure.water++;  
  
244             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  46             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  
245             /* Count for the lock itself. */  47             /* Count for the lock itself. */  
246             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  48             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  
247@@ -348,6 +353,9 @@  49@@ -324,6 +330,8 @@
   50  */
   51 static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
   52 {
   53+    CommandCost cost(EXPENSES_CONSTRUCTION);
   54+   
   55     if (GetTileOwner(tile) != OWNER_NONE) {
   56         CommandCost ret = CheckTileOwnership(tile);
   57         if (ret.Failed()) return ret;
   58@@ -337,6 +345,9 @@
   59     if (ret.Succeeded()) ret = EnsureNoVehicleOnGround(tile - delta);
   60     if (ret.Failed()) return ret;
   61 
   62+    /* Add an extra cost only if it was not built on a river. */
   63+    if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_CANAL]);
   64+
   65     if (flags & DC_EXEC) {
   66         /* Remove middle part from company infrastructure count. */
   67         Company *c = Company::GetIfValid(GetTileOwner(tile));
   68@@ -348,6 +359,7 @@
248         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  69         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  
249             MakeRiver(tile, Random());  70             MakeRiver(tile, Random());  
250         } else {  71         } else {  
251+            if (c != NULL) {  251+            if (c != NULL) c->infrastructure.water--; // Make sure it's not a leftover or neutral lock.
252+                c->infrastructure.water--;    
253+            }    
254             DoClearSquare(tile);  73             DoClearSquare(tile);  
255         }  74         }  
256         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));  75         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));  
257@@ -1276,8 +1284,14 @@  76@@ -357,7 +369,9 @@
   77         MarkCanalsAndRiversAroundDirty(tile + delta);
   78     }
   79 
   80-    return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]);
   81+    cost.AddCost(_price[PR_CLEAR_LOCK]);
   82+    return cost;
   83+
   84 }
   85 
   86 /**
   87@@ -1275,9 +1289,15 @@
   88     bool is_lock_middle = IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE;
258   89   
259     /* No need to dirty company windows here, we'll redraw the whole screen anyway. */  90     /* No need to dirty company windows here, we'll redraw the whole screen anyway. */  
260     if (is_lock_middle) Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.  91-    if (is_lock_middle) Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
261+    if (GetWaterClass(tile) == WATER_CLASS_CANAL && is_lock_middle) {  92+    if (is_lock_middle) {
262+        Company::Get(old_owner)->infrastructure.water--;  93+        Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
   94+        if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(old_owner)->infrastructure.water--;
263+    }  95+    }  
264     if (new_owner != INVALID_OWNER) {  96     if (new_owner != INVALID_OWNER) {  
265         if (is_lock_middle) Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.  97-        if (is_lock_middle) Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
266+        if (GetWaterClass(tile) == WATER_CLASS_CANAL && is_lock_middle) {  98+        if (is_lock_middle) {
267+            Company::Get(new_owner)->infrastructure.water++;  99+            Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
   100+            if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(new_owner)->infrastructure.water++;
268+        }  101+        }  
269         /* Only subtract from the old owner here if the new owner is valid,  102         /* Only subtract from the old owner here if the new owner is valid,  
270          * otherwise we clear ship depots and canal water below. */  103          * otherwise we clear ship depots and canal water below. */