Merge branch 'master' into jgrpp
# Conflicts: # src/company_cmd.cpp # src/company_func.h # src/core/overflowsafe_type.hpp # src/engine.cpp # src/music/midifile.cpp # src/network/network_command.cpp # src/newgrf_debug_gui.cpp # src/newgrf_roadstop.h # src/newgrf_spritegroup.cpp # src/os/macosx/crashlog_osx.cpp # src/os/unix/crashlog_unix.cpp # src/pathfinder/yapf/yapf_common.hpp # src/road_gui.cpp # src/saveload/engine_sl.cpp # src/script/api/script_depotlist.cpp # src/script/api/script_roadtypelist.cpp # src/settings_gui.cpp # src/settings_type.h # src/strings.cpp # src/table/settings/game_settings.ini
This commit is contained in:
@@ -27,8 +27,10 @@ ScriptDepotList::ScriptDepotList(ScriptTile::TransportType transport_type)
|
||||
|
||||
case ScriptTile::TRANSPORT_AIR: {
|
||||
/* Hangars are not seen as real depots by the depot code. */
|
||||
bool is_deity = ScriptCompanyMode::IsDeity();
|
||||
CompanyID owner = ScriptObject::GetCompany();
|
||||
for (const Station *st : Station::Iterate()) {
|
||||
if (st->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity()) {
|
||||
if (is_deity || st->owner == owner) {
|
||||
for (uint i = 0; i < st->airport.GetNumHangars(); i++) {
|
||||
this->AddItem(st->airport.GetHangarTile(i));
|
||||
}
|
||||
@@ -39,7 +41,9 @@ ScriptDepotList::ScriptDepotList(ScriptTile::TransportType transport_type)
|
||||
}
|
||||
|
||||
/* Handle 'standard' depots. */
|
||||
bool is_deity = ScriptCompanyMode::IsDeity();
|
||||
CompanyID owner = ScriptObject::GetCompany();
|
||||
for (const Depot *depot : Depot::Iterate()) {
|
||||
if ((::GetTileOwner(depot->xy) == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity()) && ::IsTileType(depot->xy, tile_type)) this->AddItem(depot->xy);
|
||||
if ((is_deity || ::GetTileOwner(depot->xy) == owner) && ::IsTileType(depot->xy, tile_type)) this->AddItem(depot->xy);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user