Codechange: put SourceType and SourceID into Source struct

This commit is contained in:
Rubidium
2025-02-05 20:15:11 +01:00
committed by rubidium42
parent 95bfd68341
commit 5f41bc0279
20 changed files with 180 additions and 199 deletions

View File

@@ -153,9 +153,10 @@ Town::~Town()
}
this->psa_list.clear();
DeleteSubsidyWith(SourceType::Town, this->index);
Source src{this->index, SourceType::Town};
DeleteSubsidyWith(src);
DeleteNewGRFInspectWindow(GSF_FAKE_TOWNS, this->index);
CargoPacket::InvalidateAllFrom(SourceType::Town, this->index);
CargoPacket::InvalidateAllFrom(src);
MarkWholeScreenDirty();
}
@@ -548,7 +549,7 @@ static void TownGenerateCargo(Town *t, CargoType ct, uint amount, StationFinder
/* Actually generate cargo and update town statistics. */
t->supplied[ct].new_max += amount;
t->supplied[ct].new_act += MoveGoodsToStation(ct, amount, SourceType::Town, t->index, stations.GetStations());;
t->supplied[ct].new_act += MoveGoodsToStation(ct, amount, {t->index, SourceType::Town}, stations.GetStations());;
}
/**