mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-22 20:00:05 +00:00
Bugfixes.
* Add newly created chunks to nearby players and NPCs. This fixes the slider/static path mob pop-in problem. * Update a player's chunks when resurrecting. This fixes a mob desync problem. * Use a private instance for the Time Lab * Spawn a slider for every stop * Fix mobs in private lairs using the template chunk mobs's current health for their max health * Don't call into the JSON lib in the loop in aggroCheck(). This is an optimization found after using gprof. * Don't print NPC deletions to console. This stops the spam when a private instance is deleted. * Changed default view distance to half the length of a map tile, so chunks are aligned to map tiles * Update tdata reference
This commit is contained in:
@@ -35,6 +35,7 @@ struct Mob : public BaseNPC {
|
||||
|
||||
// roaming
|
||||
int idleRange;
|
||||
const int sightRange;
|
||||
time_t nextMovement = 0;
|
||||
bool staticPath = false;
|
||||
|
||||
@@ -50,7 +51,9 @@ struct Mob : public BaseNPC {
|
||||
nlohmann::json data;
|
||||
|
||||
Mob(int x, int y, int z, int angle, uint64_t iID, int type, int hp, nlohmann::json d, int32_t id)
|
||||
: BaseNPC(x, y, z, angle, iID, type, id), maxHealth(hp) {
|
||||
: BaseNPC(x, y, z, angle, iID, type, id),
|
||||
maxHealth(hp),
|
||||
sightRange(d["m_iSightRange"]) {
|
||||
state = MobState::ROAMING;
|
||||
|
||||
data = d;
|
||||
|
||||
Reference in New Issue
Block a user