1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make blocks to be loaded from disk when the active block area reaches them

This commit is contained in:
Perttu Ahola 2011-11-27 12:50:35 +02:00
parent ec4f58741b
commit 5c1cb01936
4 changed files with 31 additions and 5 deletions

View file

@ -273,10 +273,11 @@ void ActiveBlockList::update(core::list<v3s16> &active_positions,
*/
ServerEnvironment::ServerEnvironment(ServerMap *map, lua_State *L,
IGameDef *gamedef):
IGameDef *gamedef, IBackgroundBlockEmerger *emerger):
m_map(map),
m_lua(L),
m_gamedef(gamedef),
m_emerger(emerger),
m_random_spawn_timer(3),
m_send_recommended_timer(0),
m_game_time(0),
@ -891,8 +892,12 @@ void ServerEnvironment::step(float dtime)
<<") became active"<<std::endl;*/
MapBlock *block = m_map->getBlockNoCreateNoEx(p);
if(block==NULL)
if(block==NULL){
// Block needs to be fetched first
m_emerger->queueBlockEmerge(p, false);
m_active_blocks.m_list.remove(p);
continue;
}
activateBlock(block);
}