core::list<v3s16> players_blockpos;
for(core::list<Player*>::Iterator
i = m_players.begin();
i != m_players.end(); i++)
{
Player *player = *i;
// Ignore disconnected players
if(player->peer_id == 0)
continue;
v3s16 blockpos = getNodeBlockPos(
floatToInt(player->getPosition(), BS));
players_blockpos.push_back(blockpos);
}
thetoon wrote:There should be a way, but it's more like a hack than a real solution. Haven't tested it yet, for I'm not on my computer. In environment.cpp, from line 990, you got :Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
core::list<v3s16> players_blockpos;
for(core::list<Player*>::Iterator
i = m_players.begin();
i != m_players.end(); i++)
{
Player *player = *i;
// Ignore disconnected players
if(player->peer_id == 0)
continue;
v3s16 blockpos = getNodeBlockPos(
floatToInt(player->getPosition(), BS));
players_blockpos.push_back(blockpos);
}
players_blockpos is a list containing players' positions (populated in the following loop). Later in the code, elements in that list are used as centers of perimeters within which blocks are considered active.
If, for any reason, coordinates where added to that list without being any player's position (say, from a table the map's sqlite file), I bet the perimeter (within active_block_range radius) around those coordinates would be considered active nonetheless.
What do you think?
OmniStudent wrote:thetoon wrote:There should be a way, but it's more like a hack than a real solution. Haven't tested it yet, for I'm not on my computer. In environment.cpp, from line 990, you got :Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
core::list<v3s16> players_blockpos;
for(core::list<Player*>::Iterator
i = m_players.begin();
i != m_players.end(); i++)
{
Player *player = *i;
// Ignore disconnected players
if(player->peer_id == 0)
continue;
v3s16 blockpos = getNodeBlockPos(
floatToInt(player->getPosition(), BS));
players_blockpos.push_back(blockpos);
}
players_blockpos is a list containing players' positions (populated in the following loop). Later in the code, elements in that list are used as centers of perimeters within which blocks are considered active.
If, for any reason, coordinates where added to that list without being any player's position (say, from a table the map's sqlite file), I bet the perimeter (within active_block_range radius) around those coordinates would be considered active nonetheless.
What do you think?
Is this executed on the server or the client?
prestidigitator wrote:I'd be more interested in an API function that forces a one-time load of a chunk with explicitly provided coordinates, as if a player had just visited (though not extending to surrounding chunks). I think this would be very useful for mods that need to know what's in some neighboring region of space, and consider it high enough priority not to just fall back to some default behavior if they get "ignore" nodes.
prestidigitator wrote:I'd be more interested in an API function that forces a one-time load of a chunk with explicitly provided coordinates, as if a player had just visited (though not extending to surrounding chunks). I think this would be very useful for mods that need to know what's in some neighboring region of space, and consider it high enough priority not to just fall back to some default behavior if they get "ignore" nodes.
paramat wrote:prestidigitator wrote:I'd be more interested in an API function that forces a one-time load of a chunk with explicitly provided coordinates, as if a player had just visited (though not extending to surrounding chunks). I think this would be very useful for mods that need to know what's in some neighboring region of space, and consider it high enough priority not to just fall back to some default behavior if they get "ignore" nodes.
Yep i have some mods that need exactly this function (landup, moonlet).
Apparently this may have just been added, see this pull request https://github.com/celeron55/minetest/pull/446
I don't understand the technical language here so i'm not sure if it has gone ahead or not.
Users browsing this forum: No registered users and 9 guests