Misc changes.

The first two fixes were caught by infer. The Big Bug(tm) remains
unfixed.

* Fixed the Leech nano power
* Fixed an unlikely nullptr dereference in ItemManager
* /toggleai now makes mobs retreat immediately, instead of waiting for
their next movement tick
* Static path mobs will now stop in place instead of retreating to
their spawn points when AI is disabled
* Changed the misleading config option name from "chunksize" to
"viewdistance", since it's actually only a third of the chunk size
This commit is contained in:
2020-10-14 23:15:02 +02:00
parent 6ee5e6d1ae
commit 5784e77654
7 changed files with 26 additions and 13 deletions

View File

@@ -109,7 +109,7 @@ bool ChunkManager::checkChunk(std::tuple<int, int, int> chunk) {
}
std::tuple<int, int, int> ChunkManager::grabChunk(int posX, int posY, int instanceID) {
return std::make_tuple(posX / (settings::CHUNKSIZE / 3), posY / (settings::CHUNKSIZE / 3), instanceID);
return std::make_tuple(posX / (settings::VIEWDISTANCE / 3), posY / (settings::VIEWDISTANCE / 3), instanceID);
}
std::vector<Chunk*> ChunkManager::grabChunks(std::tuple<int, int, int> chunk) {