Changeset - r22394:4a9ba8627ab6
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-06-09 19:04:53
frosch@openttd.org
(svn r27598) -Fix: Company 0 could accept engine previews before they were offered.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/engine.cpp
Show inline comments
 
@@ -85,6 +85,7 @@ Engine::Engine(VehicleType type, EngineI
 
	this->type = type;
 
	this->grf_prop.local_id = base;
 
	this->list_position = base;
 
	this->preview_company = INVALID_COMPANY;
 

	
 
	/* Check if this base engine is within the original engine data range */
 
	if (base >= _engine_counts[type]) {
 
@@ -902,7 +903,7 @@ CommandCost CmdSetVehicleVisibility(Tile
 
CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
 
	Engine *e = Engine::GetIfValid(p1);
 
	if (e == NULL || e->preview_company != _current_company) return CMD_ERROR;
 
	if (e == NULL || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company);
 

	
0 comments (0 inline, 0 general)