mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-21 17:10:34 +00:00
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:
@@ -279,10 +279,18 @@ void toggleAiCommand(std::string full, std::vector<std::string>& args, CNSocket*
|
||||
for (auto& pair : MobManager::Mobs) {
|
||||
pair.second->state = MobState::RETREAT;
|
||||
pair.second->target = nullptr;
|
||||
pair.second->nextMovement = getTime();
|
||||
|
||||
pair.second->roamX = pair.second->spawnX;
|
||||
pair.second->roamY = pair.second->spawnY;
|
||||
pair.second->roamZ = pair.second->spawnZ;
|
||||
// mobs with static paths can chill where they are
|
||||
if (pair.second->staticPath) {
|
||||
pair.second->roamX = pair.second->appearanceData.iX;
|
||||
pair.second->roamY = pair.second->appearanceData.iY;
|
||||
pair.second->roamZ = pair.second->appearanceData.iZ;
|
||||
} else {
|
||||
pair.second->roamX = pair.second->spawnX;
|
||||
pair.second->roamY = pair.second->spawnY;
|
||||
pair.second->roamZ = pair.second->spawnZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user