Loading

Revision differences

Old revision #pslxvnpmwNew revision #pun0ehlix
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)  
  
244             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  42             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  
245             /* Count for the lock itself. */  43             /* Count for the lock itself. */  
246             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  44             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  
247@@ -348,6 +353,9 @@  45@@ -324,6 +329,8 @@
   46  */
   47 static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
   48 {
   49+    CommandCost cost(EXPENSES_CONSTRUCTION);
   50+   
   51     if (GetTileOwner(tile) != OWNER_NONE) {
   52         CommandCost ret = CheckTileOwnership(tile);
   53         if (ret.Failed()) return ret;
   54@@ -336,7 +343,7 @@
   55     if (ret.Succeeded()) ret = EnsureNoVehicleOnGround(tile + delta);
   56     if (ret.Succeeded()) ret = EnsureNoVehicleOnGround(tile - delta);
   57     if (ret.Failed()) return ret;
   58-
   59+    if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_CANAL]);
   60     if (flags & DC_EXEC) {
   61         /* Remove middle part from company infrastructure count. */
   62         Company *c = Company::GetIfValid(GetTileOwner(tile));
   63@@ -348,6 +355,9 @@
248         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  64         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  
249             MakeRiver(tile, Random());  65             MakeRiver(tile, Random());  
250         } else {  66         } else {  
  
254             DoClearSquare(tile);  70             DoClearSquare(tile);  
255         }  71         }  
256         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));  72         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));  
257@@ -1276,8 +1284,14 @@  73@@ -357,7 +367,9 @@
   74         MarkCanalsAndRiversAroundDirty(tile + delta);
   75     }
   76 
   77-    return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]);
   78+    cost.AddCost(_price[PR_CLEAR_LOCK]);
   79+    return cost;
   80+
   81 }
   82 
   83 /**
   84@@ -1275,9 +1287,15 @@
   85     bool is_lock_middle = IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE;
258   86   
259     /* No need to dirty company windows here, we'll redraw the whole screen anyway. */  87     /* 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.  88-    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) {  89+    if (is_lock_middle) {
262+        Company::Get(old_owner)->infrastructure.water--;  90+        Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
   91+        if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(old_owner)->infrastructure.water--;
263+    }  92+    }  
264     if (new_owner != INVALID_OWNER) {  93     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.  94-        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) {  95+        if (is_lock_middle) {
267+            Company::Get(new_owner)->infrastructure.water++;  96+            Company::Get(new_owner)->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
   97+            if (GetWaterClass(tile) == WATER_CLASS_CANAL) Company::Get(new_owner)->infrastructure.water++;
268+        }  98+        }  
269         /* Only subtract from the old owner here if the new owner is valid,  99         /* Only subtract from the old owner here if the new owner is valid,  
270          * otherwise we clear ship depots and canal water below. */  100          * otherwise we clear ship depots and canal water below. */