Merge branch 'master' into jgrpp

# Conflicts:
#	src/base_media_func.h
#	src/cargopacket.h
#	src/gfxinit.cpp
#	src/industry_cmd.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2023-05-26 20:08:05 +01:00
90 changed files with 382 additions and 358 deletions

View File

@@ -153,6 +153,18 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
return c < MAX_COMPANIES && HasBit(this->company_hidden, c);
}
/**
* Get the last display variant for an engine.
* @return Engine's last display variant or engine itself if no last display variant is set.
*/
const Engine *GetDisplayVariant() const
{
if (this->display_last_variant == this->index || this->display_last_variant == INVALID_ENGINE) return this;
return Engine::Get(this->display_last_variant);
}
bool IsVariantHidden(CompanyID c) const;
/**
* Check if the engine is a ground vehicle.
* @return True iff the engine is a train or a road vehicle.