Loading

Paste #pmcof1dnt

  1. Index: src/engine.cpp
  2. ===================================================================
  3. --- src/engine.cpp  (revision 27595)
  4. +++ src/engine.cpp  (working copy)
  5. @@ -85,6 +85,7 @@
  6.     this->type = type;
  7.     this->grf_prop.local_id = base;
  8.     this->list_position = base;
  9. +   this->preview_company = INVALID_COMPANY;
  10.  
  11.     /* Check if this base engine is within the original engine data range */
  12.     if (base >= _engine_counts[type]) {
  13. @@ -902,7 +903,7 @@
  14.  CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
  15.  {
  16.     Engine *e = Engine::GetIfValid(p1);
  17. -   if (e == NULL || e->preview_company != _current_company) return CMD_ERROR;
  18. +   if (e == NULL || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR;
  19.  
  20.     if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company);
  21.  
  22.  

Comments