Loading
#openttdcoop - Paste
Archives
Trending
Docs
Login
ABAP
ActionScript
ActionScript 3
Ada
AIMMS3
ALGOL 68
Apache configuration
AppleScript
Apt sources
ARM ASSEMBLER
ASM
ASP
asymptote
Autoconf
Autohotkey
AutoIt
AviSynth
awk
BASCOM AVR
Bash
Basic4GL
BibTeX
BlitzBasic
bnf
Boo
Brainfuck
C
C#
C (LoadRunner)
C (Mac)
C (WinAPI)
C++
C++ (Qt)
C++ (WinAPI)
CAD DCL
CAD Lisp
CFDG
ChaiScript
Chapel
CIL
Clojure
CMake
COBOL
CoffeeScript
ColdFusion
CSS
Cuesheet
D
Dart
DCL
DCPU-16 Assembly
DCS
Delphi
Diff
DIV
DOS
dot
E
ECMAScript
Eiffel
eMail (mbox)
EPC
Erlang
Euphoria
EZT
F#
Falcon
FO (abas-ERP)
Formula One
Fortran
FreeBasic
FreeSWITCH
GADV 4CS
GAMBAS
GDB
genero
Genie
glSlang
GML
GNU/Octave
GNU Gettext
GNU make
Gnuplot
Go
Groovy
GwBasic
Haskell
Haxe
HicEst
HQ9+
HTML
HTML5
Icon
INI
Inno
INTERCAL
Io
ISPF Panel
J
Java
Java(TM) 2 Platform Standard Edition 5.0
Javascript
JCL
jQuery
KiXtart
KLone C
KLone C++
LaTeX
LDIF
Liberty BASIC
Lisp
LLVM Intermediate Representation
Locomotive Basic
Logtalk
LOLcode
Lotus Notes @Formulas
LotusScript
LScript
LSL2
Lua
MagikSF
MapBasic
Matlab M
Microchip Assembler
Microsoft Registry
mIRC Scripting
MMIX
Modula-2
Modula-3
MOS 6502 (6510) ACME Cross Assembler format
MOS 6502 (6510) Kick Assembler format
MOS 6502 (6510) TASM/64TASS 1.46 Assembler format
Motorola 68000 - HiSoft Devpac ST 2 Assembler format
Motorola 68000 Assembler
MXML
MySQL
Nagios
NetRexx
newlisp
nginx
Nimrod
NML NewGRF Meta Language
NSIS
Oberon-2
Objeck Programming Language
Objective-C
OCaml
OCaml (brief)
ooRexx
OpenBSD Packet Filter
OpenOffice.org Basic
Oracle 8 SQL
Oracle 11 SQL
Oxygene
OZ
ParaSail
PARI/GP
Pascal
PCRE
per
Perl
Perl 6
PHP
PHP (brief)
PIC16
Pike
Pixel Bender 1.0
PL/I
PL/SQL
PostgreSQL
PostScript
POVRAY
PowerBuilder
PowerShell
ProFTPd configuration
Progress
Prolog
PROPERTIES
ProvideX
Puppet
PureBasic
Python
Python for S60
q/kdb+
QBasic/QuickBASIC
QML
R / S+
Racket
Rails
RBScript
REBOL
rexx
robots.txt
RPM Specification File
Ruby
Rust
SAS
Scala
Scheme
SciLab
SCL
sdlBasic
Smalltalk
Smarty
SPARK
SPARQL
SQL
Squirrel Script
Squirrel Script with OpenTTD AI/GS
StandardML
StoneScript
SystemVerilog
T-SQL
TCL
Tera Term Macro
Text
thinBasic
TypoScript
Unicon (Unified Extended Dialect of Icon)
Uno Idl
Unreal Script
UPC
Urbi
Vala
vb.net
VBScript
Vedit macro language
Verilog
VHDL
Vim Script
Visual Basic
Visual Fox Pro
Visual Prolog
Whitespace
Whois (RPSL format)
Winbatch
X++
XBasic
XML
Xorg configuration
YAML
ZiLOG Z80 Assembler
ZXBasic
Index: docs/landscape.html =================================================================== --- docs/landscape.html (revision 27198) +++ docs/landscape.html (working copy) @@ -975,7 +975,7 @@ </li> <li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li> <li>m6 bit 2: pbs reservation state for railway stations/waypoints</li> - + <li>m6 bit 0: river restoration flag for whenever a canal is removed</li> <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li> <li>m7 bits 7..6: present road types (road stops)</li> <li>m7: animation frame (railway stations/waypoints, airports)</li> @@ -1088,6 +1088,7 @@ </tr> </table> </li> + <li>m6 bit 0: river restoration flag for whenever a canal is removed</li> </ul> </td> </tr> @@ -1429,6 +1430,7 @@ </li> <li>m6 bits 5..3: random triggers (NewGRF)</li> <li>m6 bit 2: bit 8 of type (see m5)</li> + <li>m6 bit 0: river restoration flag for whenever a canal is removed</li> <li>m7: animation frame</li> </ul> </td> @@ -1599,6 +1601,7 @@ <li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li> <li>m3: random bits</li> <li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li> + <li>m6 bit 0: river restoration flag for whenever a canal is removed</li> <li>m7: animation counter</li> </ul> </td> Index: docs/landscape_grid.html =================================================================== --- docs/landscape_grid.html (revision 27198) +++ docs/landscape_grid.html (working copy) @@ -236,7 +236,7 @@ <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="option">~~~~ ~</span>XXX</td> - <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td> + <td class="bits"><span class="free">OO</span>XX X<span class="free">OO</span>X</td> <td class="bits"><span class="free">OOOO OOOO</span></td> </tr> <tr> @@ -260,7 +260,7 @@ <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="option">~~~~ ~~~~</span></td> - <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td> + <td class="bits"><span class="free">OO</span>XX X<span class="free">OO</span>X</td> <td class="bits"><span class="free">OOOO OOOO</span></td> </tr> <tr> @@ -272,7 +272,7 @@ <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="option">~~~~ ~~~~</span></td> - <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td> + <td class="bits"><span class="free">OO</span>XX X<span class="free">OO</span>X</td> <td class="bits"><span class="free">OOOO OOOO</span></td> </tr> <tr> @@ -297,8 +297,8 @@ <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits">XXXX XXXX</td> <td class="bits">-inherit-</td> + <td class="bits"><span class="free">OOOO OOO</span>X</td> <td class="bits"><span class="free">OOOO OOOO</span></td> - <td class="bits"><span class="free">OOOO OOOO</span></td> </tr> <tr> <td class="caption">shipdepot</td> @@ -309,8 +309,8 @@ <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits">-inherit-</td> + <td class="bits"><span class="free">OOOO OOO</span>X</td> <td class="bits"><span class="free">OOOO OOOO</span></td> - <td class="bits"><span class="free">OOOO OOOO</span></td> </tr> <tr> <td>8</td> @@ -322,7 +322,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> - <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td> + <td class="bits"><span class="free">OO</span>XX XX<span class="free">O</span>X</td> <td class="bits">XXXX XXXX</td> </tr> <tr> @@ -360,7 +360,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits"><span class="free">OOOO OOOO</span></td> <td class="bits">XXXX XXXX</td> - <td class="bits"><span class="free">OOOO OOOO</span></td> + <td class="bits"><span class="free">OOOO OOO</span>X</td> <td class="bits">XXXX XXXX</td> </tr> </tbody> Index: src/industry_cmd.cpp =================================================================== --- src/industry_cmd.cpp (revision 27198) +++ src/industry_cmd.cpp (working copy) @@ -1755,9 +1755,9 @@ i->location.Add(cur_tile); WaterClass wc = (IsWaterTile(cur_tile) ? GetWaterClass(cur_tile) : WATER_CLASS_INVALID); - + bool river = HasBit(_me[cur_tile].m6, 0); DoCommand(cur_tile, 0, 0, DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR); - + if (river) SB(_me[cur_tile].m6, 0, 1, 1); MakeIndustry(cur_tile, i->index, it->gfx, Random(), wc); if (_generating_world) { Index: src/station_cmd.cpp =================================================================== --- src/station_cmd.cpp (revision 27198) +++ src/station_cmd.cpp (working copy) @@ -2511,7 +2511,7 @@ /* Get the water class of the water tile before it is cleared.*/ WaterClass wc = GetWaterClass(tile_cur); - + bool river = HasBit(_me[tile_cur].m6, 0); ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret; @@ -2551,7 +2551,7 @@ DirtyCompanyInfrastructureWindows(st->owner); MakeDock(tile, st->owner, st->index, direction, wc); - + if (river) SB(_me[tile + TileOffsByDiagDir(direction)].m6, 0, 1, 1); st->UpdateVirtCoord(); UpdateStationAcceptance(st, false); st->RecomputeIndustriesNear(); Index: src/water_cmd.cpp =================================================================== --- src/water_cmd.cpp (revision 27198) +++ src/water_cmd.cpp (working copy) @@ -123,6 +123,8 @@ CommandCost cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_DEPOT_SHIP]); bool add_cost = !IsWaterTile(tile); + bool river1 = HasBit(_me[tile].m6, 0); + bool river2 = HasBit(_me[tile2].m6, 0); CommandCost ret = DoCommand(tile, 0, 0, flags | DC_AUTO, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret; if (add_cost) { @@ -145,7 +147,8 @@ } Company::Get(_current_company)->infrastructure.water += 2 * LOCK_DEPOT_TILE_FACTOR; DirtyCompanyInfrastructureWindows(_current_company); - + if (river1) SB(_me[tile].m6, 0, 1, 1); + if (river2) SB(_me[tile2].m6, 0, 1, 1); MakeShipDepot(tile, _current_company, depot->index, DEPOT_PART_NORTH, axis, wc1); MakeShipDepot(tile2, _current_company, depot->index, DEPOT_PART_SOUTH, axis, wc2); MarkTileDirtyByTile(tile); @@ -192,7 +195,7 @@ wc = WATER_CLASS_CANAL; } - + bool river = HasBit(_me[tile].m6, 0); /* Zero map array and terminate animation */ DoClearSquare(tile); @@ -199,7 +202,9 @@ /* Maybe change to water */ switch (wc) { case WATER_CLASS_SEA: MakeSea(tile); break; - case WATER_CLASS_CANAL: MakeCanal(tile, o, Random()); break; + case WATER_CLASS_CANAL: MakeCanal(tile, o, Random()); + if (river) SB(_me[tile].m6, 0, 1, 1); + break; case WATER_CLASS_RIVER: MakeRiver(tile, Random()); break; default: break; } @@ -291,7 +296,8 @@ if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) { return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); } - + bool river_lower = HasBit(_me[tile - delta].m6, 0); + bool river_upper = HasBit(_me[tile + delta].m6, 0); if (flags & DC_EXEC) { /* Update company infrastructure counts. */ Company *c = Company::GetIfValid(_current_company); @@ -303,7 +309,8 @@ c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles. DirtyCompanyInfrastructureWindows(_current_company); } - + if (river_lower) SB(_me[tile - delta].m6, 0, 1, 1); + if (river_upper) SB(_me[tile + delta].m6, 0, 1, 1); MakeLock(tile, _current_company, dir, wc_lower, wc_upper, wc_middle); MarkTileDirtyByTile(tile); MarkTileDirtyByTile(tile - delta); @@ -419,6 +426,7 @@ if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue; bool water = IsWaterTile(tile); + bool river = HasTileWaterClass(tile) && GetWaterClass(tile) == WATER_CLASS_RIVER; ret = DoCommand(tile, 0, 0, flags | DC_FORCE_CLEAR_TILE, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret; @@ -442,6 +450,7 @@ /* FALL THROUGH */ default: + if (river) SB(_me[tile].m6, 0, 1, 1); MakeCanal(tile, _current_company, Random()); if (Company::IsValidID(_current_company)) { Company::Get(_current_company)->infrastructure.water++; @@ -465,6 +474,7 @@ static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags) { + bool river = HasBit(_me[tile].m6, 0); switch (GetWaterTileType(tile)) { case WATER_TILE_CLEAR: { if (flags & DC_NO_WATER) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER); @@ -492,6 +502,7 @@ DirtyCompanyInfrastructureWindows(owner); } DoClearSquare(tile); + if (river) MakeRiver(tile, Random()); MarkCanalsAndRiversAroundDirty(tile); }
Mark as private
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
forever