Index: src/gamecontrol.cpp =================================================================== --- src/gamecontrol.cpp (revision 1360) +++ src/gamecontrol.cpp (working copy) @@ -37,7 +37,6 @@ _finances_manager.SetScenario(_scenario); _date.Initialize(); _weather.Initialize(); - _guests.Initialize(); _game_mode_mgr.SetGameMode(GM_PLAY); Index: src/people.cpp =================================================================== --- src/people.cpp (revision 1360) +++ src/people.cpp (working copy) @@ -75,7 +75,6 @@ this->start_voxel.y = -1; this->daily_frac = 0; this->next_daily_index = 0; - this->valid_ptypes = 0; } Guests::~Guests() @@ -82,34 +81,7 @@ { } -/** After loading the RCD files, check what resources actually exist. */ -void Guests::Initialize() -{ - this->valid_ptypes = 0; - PersonType pertype = PERSON_GUEST; - bool usable = true; - - for (AnimationType antype = ANIM_BEGIN; antype <= ANIM_LAST; antype++) { - if (_sprite_manager.GetAnimation(antype, pertype) == nullptr) { - usable = false; - break; - } - } - if (usable) this->valid_ptypes |= 1u << (pertype - PERSON_ANY); -} - /** - * Can guests of the given person type be used for the level? - * @param ptype %Person type to examine. - * @return Whether the given person type can be used for playing a level. - */ -bool Guests::CanUsePersonType(PersonType ptype) -{ - if (ptype != PERSON_GUEST) return false; - return (this->valid_ptypes & (1 << (ptype - PERSON_ANY))) != 0; -} - -/** * Update #free_idx to the next free guest (if available). * @return Whether a free guest was found. */ @@ -192,12 +164,10 @@ /** * A new day arrived, handle daily chores of the park. * @todo Add popularity rating concept. - * @todo Person type should be configurable too. */ void Guests::OnNewDay() { - PersonType ptype = PERSON_GUEST; - if (!this->CanUsePersonType(ptype)) return; + /* Try adding a new guest to the park. */ if (this->CountActiveGuests() >= _scenario.max_guests) return; if (!this->rnd.Success1024(_scenario.GetSpawnProbability(512))) return; @@ -210,7 +180,7 @@ if (!this->HasFreeGuests()) return; // No more quests available. /* New guest! */ Guest *g = this->GetFree(); - g->Activate(this->start_voxel, ptype); + g->Activate(this->start_voxel, PERSON_GUEST); } /** Index: src/people.h =================================================================== --- src/people.h (revision 1360) +++ src/people.h (working copy) @@ -60,7 +60,6 @@ /** * All our guests. * @todo Allow to have several blocks of guests. - * @todo #valid_ptypes should be removed. */ class Guests { public: @@ -67,8 +66,6 @@ Guests(); ~Guests(); - void Initialize(); - bool CanUsePersonType(PersonType ptype); uint CountActiveGuests(); /** @@ -106,8 +103,6 @@ int daily_frac; ///< Frame counter. int next_daily_index; ///< Index of the next guest to give daily service. - uint16 valid_ptypes; ///< Person types that can be used. - bool FindNextFreeGuest(); bool FindNextFreeGuest() const; bool HasFreeGuests() const; @@ -114,7 +109,6 @@ void AddFree(Guest *g); Guest *GetFree(); }; -assert_compile(PERSON_GUEST + 1 <= 16); ///< Verify that all person types fit in #Guests::valid_ptypes extern Guests _guests;