Loading

Paste #pe4c1po6r

  1. Index: src/gamecontrol.cpp
  2. ===================================================================
  3. --- src/gamecontrol.cpp (revision 1360)
  4. +++ src/gamecontrol.cpp (working copy)
  5. @@ -37,7 +37,6 @@
  6.     _finances_manager.SetScenario(_scenario);
  7.     _date.Initialize();
  8.     _weather.Initialize();
  9. -   _guests.Initialize();
  10.  
  11.     _game_mode_mgr.SetGameMode(GM_PLAY);
  12.  
  13. Index: src/people.cpp
  14. ===================================================================
  15. --- src/people.cpp  (revision 1360)
  16. +++ src/people.cpp  (working copy)
  17. @@ -75,7 +75,6 @@
  18.     this->start_voxel.y = -1;
  19.     this->daily_frac = 0;
  20.     this->next_daily_index = 0;
  21. -   this->valid_ptypes = 0;
  22.  }
  23.  
  24.  Guests::~Guests()
  25. @@ -82,34 +81,7 @@
  26.  {
  27.  }
  28.  
  29. -/** After loading the RCD files, check what resources actually exist. */
  30. -void Guests::Initialize()
  31. -{
  32. -   this->valid_ptypes = 0;
  33. -   PersonType pertype = PERSON_GUEST;
  34. -   bool usable = true;
  35. -
  36. -   for (AnimationType antype = ANIM_BEGIN; antype <= ANIM_LAST; antype++) {
  37. -       if (_sprite_manager.GetAnimation(antype, pertype) == nullptr) {
  38. -           usable = false;
  39. -           break;
  40. -       }
  41. -   }
  42. -   if (usable) this->valid_ptypes |= 1u << (pertype - PERSON_ANY);
  43. -}
  44. -
  45.  /**
  46. - * Can guests of the given person type be used for the level?
  47. - * @param ptype %Person type to examine.
  48. - * @return Whether the given person type can be used for playing a level.
  49. - */
  50. -bool Guests::CanUsePersonType(PersonType ptype)
  51. -{
  52. -   if (ptype != PERSON_GUEST) return false;
  53. -   return (this->valid_ptypes & (1 << (ptype - PERSON_ANY))) != 0;
  54. -}
  55. -
  56. -/**
  57.   * Update #free_idx to the next free guest (if available).
  58.   * @return Whether a free guest was found.
  59.   */
  60. @@ -192,12 +164,10 @@
  61.  /**
  62.   * A new day arrived, handle daily chores of the park.
  63.   * @todo Add popularity rating concept.
  64. - * @todo Person type should be configurable too.
  65.   */
  66.  void Guests::OnNewDay()
  67.  {
  68. -   PersonType ptype = PERSON_GUEST;
  69. -   if (!this->CanUsePersonType(ptype)) return;
  70. +   /* Try adding a new guest to the park. */
  71.     if (this->CountActiveGuests() >= _scenario.max_guests) return;
  72.     if (!this->rnd.Success1024(_scenario.GetSpawnProbability(512))) return;
  73.  
  74. @@ -210,7 +180,7 @@
  75.     if (!this->HasFreeGuests()) return; // No more quests available.
  76.     /* New guest! */
  77.     Guest *g = this->GetFree();
  78. -   g->Activate(this->start_voxel, ptype);
  79. +   g->Activate(this->start_voxel, PERSON_GUEST);
  80.  }
  81.  
  82.  /**
  83. Index: src/people.h
  84. ===================================================================
  85. --- src/people.h    (revision 1360)
  86. +++ src/people.h    (working copy)
  87. @@ -60,7 +60,6 @@
  88.  /**
  89.   * All our guests.
  90.   * @todo Allow to have several blocks of guests.
  91. - * @todo #valid_ptypes should be removed.
  92.   */
  93.  class Guests {
  94.  public:
  95. @@ -67,8 +66,6 @@
  96.     Guests();
  97.     ~Guests();
  98.  
  99. -   void Initialize();
  100. -   bool CanUsePersonType(PersonType ptype);
  101.     uint CountActiveGuests();
  102.  
  103.     /**
  104. @@ -106,8 +103,6 @@
  105.     int daily_frac;       ///< Frame counter.
  106.     int next_daily_index; ///< Index of the next guest to give daily service.
  107.  
  108. -   uint16 valid_ptypes;  ///< Person types that can be used.
  109. -
  110.     bool FindNextFreeGuest();
  111.     bool FindNextFreeGuest() const;
  112.     bool HasFreeGuests() const;
  113. @@ -114,7 +109,6 @@
  114.     void AddFree(Guest *g);
  115.     Guest *GetFree();
  116.  };
  117. -assert_compile(PERSON_GUEST + 1 <= 16); ///< Verify that all person types fit in #Guests::valid_ptypes
  118.  
  119.  extern Guests _guests;

Comments