mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Change many useless std::list into Environment class (m_players), ABMHandler and ActiveBlockList::update
This improve looping performances.
This commit is contained in:
@@ -75,8 +75,8 @@ public:
|
||||
Player * getPlayer(const char *name);
|
||||
Player * getRandomConnectedPlayer();
|
||||
Player * getNearestConnectedPlayer(v3f pos);
|
||||
std::list<Player*> getPlayers();
|
||||
std::list<Player*> getPlayers(bool ignore_disconnected);
|
||||
std::vector<Player*> getPlayers();
|
||||
std::vector<Player*> getPlayers(bool ignore_disconnected);
|
||||
|
||||
u32 getDayNightRatio();
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
protected:
|
||||
// peer_ids in here should be unique, except that there may be many 0s
|
||||
std::list<Player*> m_players;
|
||||
std::vector<Player*> m_players;
|
||||
// Time of day in milli-hours (0-23999); determines day and night
|
||||
u32 m_time_of_day;
|
||||
// Time of day in 0...1
|
||||
@@ -182,7 +182,7 @@ struct ABMWithState
|
||||
class ActiveBlockList
|
||||
{
|
||||
public:
|
||||
void update(std::list<v3s16> &active_positions,
|
||||
void update(std::vector<v3s16> &active_positions,
|
||||
s16 radius,
|
||||
std::set<v3s16> &blocks_removed,
|
||||
std::set<v3s16> &blocks_added);
|
||||
|
Reference in New Issue
Block a user