28 changes: 15 additions & 13 deletions src/mapsector.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class IGameDef;
class MapSector
{
public:

MapSector(Map *parent, v2s16 pos, IGameDef *gamedef);
virtual ~MapSector();

Expand All @@ -58,16 +58,18 @@ class MapSector
MapBlock * createBlankBlock(s16 y);

void insertBlock(MapBlock *block);

void deleteBlock(MapBlock *block);

void getBlocks(MapBlockVect &dest);


bool empty();

// Always false at the moment, because sector contains no metadata.
bool differs_from_disk;

protected:

// The pile of MapBlocks
std::map<s16, MapBlock*> m_blocks;

Expand All @@ -76,12 +78,12 @@ class MapSector
v2s16 m_pos;

IGameDef *m_gamedef;

// Last-used block is cached here for quicker access.
// Be sure to set this to NULL when the cached block is deleted
// Be sure to set this to NULL when the cached block is deleted
MapBlock *m_block_cache;
s16 m_block_cache_y;

/*
Private methods
*/
Expand All @@ -94,7 +96,7 @@ class ServerMapSector : public MapSector
public:
ServerMapSector(Map *parent, v2s16 pos, IGameDef *gamedef);
~ServerMapSector();

u32 getId() const
{
return MAPSECTOR_SERVER;
Expand All @@ -106,15 +108,15 @@ class ServerMapSector : public MapSector
*/

void serialize(std::ostream &os, u8 version);

static ServerMapSector* deSerialize(
std::istream &is,
Map *parent,
v2s16 p2d,
std::map<v2s16, MapSector*> & sectors,
IGameDef *gamedef
);

private:
};

Expand All @@ -124,7 +126,7 @@ class ClientMapSector : public MapSector
public:
ClientMapSector(Map *parent, v2s16 pos, IGameDef *gamedef);
~ClientMapSector();

u32 getId() const
{
return MAPSECTOR_CLIENT;
Expand All @@ -133,6 +135,6 @@ class ClientMapSector : public MapSector
private:
};
#endif

#endif

3 changes: 2 additions & 1 deletion src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ void Server::AsyncRunStep(bool initial_step)
// Run Map's timers and unload unused data
ScopeProfiler sp(g_profiler, "Server: map timer and unload");
m_env->getMap().timerUpdate(map_timer_and_unload_dtime,
g_settings->getFloat("server_unload_unused_data_timeout"));
g_settings->getFloat("server_unload_unused_data_timeout"),
(u32)-1);
}

/*
Expand Down