diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-04-05 02:38:43 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2021-04-12 23:35:07 +0200 |
commit | 4cd49d7eca5f8fd53eb98577a1f218a5086704bb (patch) | |
tree | 09bf29a1d30a37445796ed70867f934435c4261f /src/Mobs/Monster.cpp | |
parent | Fixed generator for the Mega Taiga biome (#5129) (diff) | |
download | cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.gz cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.bz2 cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.lz cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.xz cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.tar.zst cuberite-4cd49d7eca5f8fd53eb98577a1f218a5086704bb.zip |
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r-- | src/Mobs/Monster.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 09c0974a0..74cceff91 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -1150,34 +1150,26 @@ cMonster::eFamily cMonster::FamilyFromType(eMonsterType a_Type) case mtZombieHorse: return mfPassive; case mtZombiePigman: return mfHostile; case mtZombieVillager: return mfHostile; - - default: - { - ASSERT(!"Unhandled mob type"); - return mfUnhandled; - } + case mtInvalidType: break; } + UNREACHABLE("Unhandled mob type"); } -int cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily) +cTickTime cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily) { switch (a_MobFamily) { - case mfHostile: return 40; - case mfPassive: return 40; - case mfAmbient: return 40; - case mfWater: return 400; - case mfNoSpawn: return -1; - default: - { - ASSERT(!"Unhandled mob family"); - return -1; - } + case mfHostile: return 40_tick; + case mfPassive: return 40_tick; + case mfAmbient: return 40_tick; + case mfWater: return 400_tick; + case mfNoSpawn: return -1_tick; } + UNREACHABLE("Unhandled mob family"); } @@ -1654,7 +1646,7 @@ bool cMonster::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk) if ( (Chunk->GetBlock(Rel) != E_BLOCK_SOULSAND) && // Not on soulsand - (GetWorld()->GetTimeOfDay() < 12000 + 1000) && // Daytime + (GetWorld()->GetTimeOfDay() < 13000_tick) && // Daytime Chunk->IsWeatherSunnyAt(Rel.x, Rel.z) && // Not raining !IsInWater() // Isn't swimming ) |