From d2eb58f27780a3c65fedd0d21d152ee8866ebb86 Mon Sep 17 00:00:00 2001 From: mgueydan Date: Sat, 7 Sep 2013 22:19:56 +0200 Subject: Adding mob census (sorry this is a big commit as work was done before git integration i couldn't split it more) --- source/World.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/World.h') diff --git a/source/World.h b/source/World.h index 1f82f4efc..6fb5c619b 100644 --- a/source/World.h +++ b/source/World.h @@ -42,6 +42,7 @@ class cChunkGenerator; // The thread responsible for generating chunks class cChestEntity; class cDispenserEntity; class cFurnaceEntity; +class cMobCensus; typedef std::list< cPlayer * > cPlayerList; -- cgit v1.2.3 From 04151677d57905e35993eac4899e6bd72831ec6f Mon Sep 17 00:00:00 2001 From: mgueydan Date: Sun, 8 Sep 2013 01:43:55 +0200 Subject: Disabeling current mob spawning and tick --- source/World.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/World.h') diff --git a/source/World.h b/source/World.h index 6fb5c619b..eb19dce40 100644 --- a/source/World.h +++ b/source/World.h @@ -711,8 +711,8 @@ private: /// Handles the weather in each tick void TickWeather(float a_Dt); - /// Handles the mob spawning each tick - void TickSpawnMobs(float a_Dt); + /// Handles the mob spawning/moving/destroying each tick + void TickMobs(float a_Dt); /// Executes all tasks queued onto the tick thread void TickQueuedTasks(void); -- cgit v1.2.3 From 7a5e3592ffcc80f8c768ed2391b0ad521c59b67e Mon Sep 17 00:00:00 2001 From: mgueydan Date: Sun, 8 Sep 2013 02:47:02 +0200 Subject: Adding glue to call everything done in last commits - now the mobs are spawning --- source/World.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/World.h') diff --git a/source/World.h b/source/World.h index eb19dce40..4590fb9c3 100644 --- a/source/World.h +++ b/source/World.h @@ -574,6 +574,7 @@ public: /// Spawns a mob of the specified type. Returns the mob's EntityID if recognized and spawned, <0 otherwise int SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eType a_MonsterType); // tolua_export + int SpawnMobFinalize(cMonster* a_Monster); /// Creates a projectile of the specified type. Returns the projectile's EntityID if successful, <0 otherwise int CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const Vector3d * a_Speed = NULL); // tolua_export @@ -626,7 +627,7 @@ private: Int64 m_LastTimeUpdate; // The tick in which the last time update has been sent. Int64 m_LastUnload; // The last WorldAge (in ticks) in which unloading was triggerred Int64 m_LastSave; // The last WorldAge (in ticks) in which save-all was triggerred - Int64 m_LastSpawnMonster; // The last WorldAge (in ticks) in which a monster was spawned + std::map m_LastSpawnMonster; // The last WorldAge (in ticks) in which a monster was spawned (for each megatype of monster) // MG TODO : find a way to optimize without creating unmaintenability (if mob IDs are becoming unrowed) eGameMode m_GameMode; bool m_bEnabledPVP; @@ -656,7 +657,7 @@ private: cChunkMap * m_ChunkMap; bool m_bAnimals; - Int64 m_SpawnMonsterRate; + std::set m_AllowedMobs; eWeather m_Weather; int m_WeatherInterval; -- cgit v1.2.3