diff options
author | Bond-009 <bond.009@outlook.com> | 2018-02-03 12:24:19 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2020-04-10 01:50:45 +0200 |
commit | 8438def87e40e43fd66d38dbf8cc287cea7de29b (patch) | |
tree | 647b7674cca3df58507e5311e5578d14084bc691 /src/Mobs/Monster.cpp | |
parent | Re-enable darwin download from easyinstall.sh script (diff) | |
download | cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.gz cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.bz2 cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.lz cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.xz cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.tar.zst cuberite-8438def87e40e43fd66d38dbf8cc287cea7de29b.zip |
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r-- | src/Mobs/Monster.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 5e3026a57..d20afa589 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -69,6 +69,7 @@ static const struct {mtWolf, "wolf", "Wolf", "wolf"}, {mtZombie, "zombie", "Zombie", "zombie"}, {mtZombiePigman, "zombiepigman", "PigZombie", "zombie_pigman"}, + {mtZombieVillager, "zombievillager", "ZombieVillager", "zombie_villager"}, } ; @@ -662,6 +663,7 @@ void cMonster::KilledBy(TakeDamageInfo & a_TDI) case mtWitherSkeleton: case mtZombie: case mtZombiePigman: + case mtZombieVillager: case mtSlime: case mtMagmaCube: { @@ -1078,6 +1080,7 @@ cMonster::eFamily cMonster::FamilyFromType(eMonsterType a_Type) case mtWolf: return mfPassive; case mtZombie: return mfHostile; case mtZombiePigman: return mfHostile; + case mtZombieVillager: return mfHostile; default: { @@ -1176,17 +1179,7 @@ std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_MobType) { return cpp14::make_unique<cSlime>(1 << Random.RandInt(2)); // Size 1, 2 or 4 } - case mtVillager: - { - int VillagerType = Random.RandInt(6); - if (VillagerType == 6) - { - // Give farmers a better chance of spawning - VillagerType = 0; - } - - return cpp14::make_unique<cVillager>(static_cast<cVillager::eVillagerType>(VillagerType)); - } + case mtVillager: return cpp14::make_unique<cVillager>(cVillager::GetRandomProfession()); case mtHorse: { // Horses take a type (species), a colour, and a style (dots, stripes, etc.) @@ -1203,7 +1196,10 @@ std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_MobType) return cpp14::make_unique<cHorse>(HorseType, HorseColor, HorseStyle, HorseTameTimes); } - + case mtZombieVillager: + { + return cpp14::make_unique<cZombieVillager>(cVillager::GetRandomProfession()); + } case mtBat: return cpp14::make_unique<cBat>(); case mtBlaze: return cpp14::make_unique<cBlaze>(); case mtCaveSpider: return cpp14::make_unique<cCaveSpider>(); |