Changeset - r26187:3179878cd616
[Not reviewed]
master
0 3 0
Tyler Trahan - 2 years ago 2022-02-22 21:00:37
tyler@tylertrahan.com
Fix #9020: Update station coverage highlight when adding/removing tiles
3 files changed with 13 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -744,9 +744,16 @@ static void DeleteStationIfEmpty(BaseSta
 
void Station::AfterStationTileSetChange(bool adding, StationType type)
 
{
 
	this->UpdateVirtCoord();
 
	this->RecomputeCatchment();
 
	DirtyCompanyInfrastructureWindows(this->owner);
 
	if (adding) InvalidateWindowData(WC_STATION_LIST, this->owner, 0);
 

	
 
	if (adding) {
 
		this->RecomputeCatchment();
 
		MarkCatchmentTilesDirty();
 
		InvalidateWindowData(WC_STATION_LIST, this->owner, 0);
 
	} else {
 
		MarkCatchmentTilesDirty();
 
		this->RecomputeCatchment();
 
	}
 

	
 
	switch (type) {
 
		case STATION_RAIL:
 
@@ -1628,6 +1635,7 @@ CommandCost RemoveFromRailBaseStation(Ti
 
		if (st->train_station.tile == INVALID_TILE) {
 
			st->facilities &= ~FACIL_TRAIN;
 
			SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS);
 
			MarkCatchmentTilesDirty();
 
			st->UpdateVirtCoord();
 
			DeleteStationIfEmpty(st);
 
		}
 
@@ -1662,6 +1670,7 @@ CommandCost CmdRemoveFromRailStation(DoC
 

	
 
		if (st->train_station.tile == INVALID_TILE) SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS);
 
		st->MarkTilesDirty(false);
 
		MarkCatchmentTilesDirty();
 
		st->RecomputeCatchment();
 
	}
 

	
src/viewport.cpp
Show inline comments
 
@@ -3495,7 +3495,7 @@ CommandCost CmdScrollViewport(DoCommandF
 
	return CommandCost();
 
}
 

	
 
static void MarkCatchmentTilesDirty()
 
void MarkCatchmentTilesDirty()
 
{
 
	if (_viewport_highlight_town != nullptr) {
 
		MarkWholeScreenDirty();
src/viewport_func.h
Show inline comments
 
@@ -98,5 +98,6 @@ struct Town;
 

	
 
void SetViewportCatchmentStation(const Station *st, bool sel);
 
void SetViewportCatchmentTown(const Town *t, bool sel);
 
void MarkCatchmentTilesDirty();
 

	
 
#endif /* VIEWPORT_FUNC_H */
0 comments (0 inline, 0 general)