From 61904af626b036b6e4e045ca219b2a361aa45a6e Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 11 Oct 2019 11:02:53 +0200 Subject: Moved growing from cWorld / cChunk to cBlockHandler descendants. --- src/MobSpawner.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/MobSpawner.h') diff --git a/src/MobSpawner.h b/src/MobSpawner.h index 695467692..7d5ce5274 100644 --- a/src/MobSpawner.h +++ b/src/MobSpawner.h @@ -27,8 +27,8 @@ public : /** Try to create a monster here If this is the first of a Pack, determine the type of monster a_Biome, BlockType & BlockMeta are used to decide what kind of Mob can Spawn here - a_MaxPackSize is set to the maximal size for a pack this type of mob */ - cMonster * TryToSpawnHere(cChunk * a_Chunk, int A_RelX, int a_RelY, int a_RelZ, EMCSBiome a_Biome, int & a_MaxPackSize); + a_MaxPackSize is set to the maximum size for a pack this type of mob */ + cMonster * TryToSpawnHere(cChunk * a_Chunk, Vector3i a_RelPos, EMCSBiome a_Biome, int & a_MaxPackSize); /** Mark the beginning of a new Pack. All mobs of the same Pack are the same type */ @@ -43,12 +43,14 @@ public : } /** Returns true if specified type of mob can spawn on specified block */ - static bool CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, eMonsterType a_MobType, EMCSBiome a_Biome); + static bool CanSpawnHere(cChunk * a_Chunk, Vector3i a_RelPos, eMonsterType a_MobType, EMCSBiome a_Biome); /** Returns all mob types that can spawn that biome */ static std::set GetAllowedMobTypes(EMCSBiome a_Biome); + protected : + /** Returns a random type that can spawn in the specified biome. Returns mtInvalidType if none is possible. */ eMonsterType ChooseMobType(EMCSBiome a_Biome); -- cgit v1.2.3