summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-04-26 05:49:55 +0200
committerarchshift <admin@archshift.com>2014-04-26 05:49:55 +0200
commit80b97fd9dd584c439ca25efaa7e5172da1509628 (patch)
treed3485e1309f225c35da7d78744cd42f2896c1216
parentMoved switch{} out of GetArmorCoverAgainst(). (diff)
downloadcuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar.gz
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar.bz2
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar.lz
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar.xz
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.tar.zst
cuberite-80b97fd9dd584c439ca25efaa7e5172da1509628.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp7
-rw-r--r--src/Mobs/Monster.h1
-rw-r--r--src/OSSupport/File.cpp10
3 files changed, 11 insertions, 7 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index f68d2ef75..14d951393 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -761,9 +761,10 @@ cMonster::eFamily cMonster::FamilyFromType(eType a_Type)
case mtChicken: return mfPassive;
case mtCow: return mfPassive;
case mtCreeper: return mfHostile;
+ case mtEnderDragon: return mfNoSpawn;
case mtEnderman: return mfHostile;
case mtGhast: return mfHostile;
- case mtGiant: return mfHostile;
+ case mtGiant: return mfNoSpawn;
case mtHorse: return mfPassive;
case mtIronGolem: return mfPassive;
case mtMagmaCube: return mfHostile;
@@ -774,11 +775,12 @@ cMonster::eFamily cMonster::FamilyFromType(eType a_Type)
case mtSilverfish: return mfHostile;
case mtSkeleton: return mfHostile;
case mtSlime: return mfHostile;
+ case mtSnowGolem: return mfNoSpawn;
case mtSpider: return mfHostile;
case mtSquid: return mfWater;
case mtVillager: return mfPassive;
case mtWitch: return mfHostile;
- case mtWither: return mfHostile;
+ case mtWither: return mfNoSpawn;
case mtWolf: return mfHostile;
case mtZombie: return mfHostile;
case mtZombiePigman: return mfHostile;
@@ -801,6 +803,7 @@ int cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily)
case mfPassive: return 40;
case mfAmbient: return 40;
case mfWater: return 400;
+ case mfNoSpawn: return -1;
case mfUnhandled: break;
}
ASSERT(!"Unhandled mob family");
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 0243f6637..6b9c4fab8 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -66,6 +66,7 @@ public:
mfAmbient = 2, // Bats
mfWater = 3, // Squid
+ mfNoSpawn,
mfUnhandled, // Nothing. Be sure this is the last and the others are in order
} ;
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index 7f0f0ad2f..f1b3bcf9e 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -67,11 +67,11 @@ bool cFile::Open(const AString & iFileName, eMode iMode)
case fmRead: Mode = "rb"; break;
case fmWrite: Mode = "wb"; break;
case fmReadWrite: Mode = "rb+"; break;
- default:
- {
- ASSERT(!"Unhandled file mode");
- return false;
- }
+ }
+ if (Mode == NULL)
+ {
+ ASSERT(!"Unhandled file mode");
+ return false;
}
#ifdef _WIN32