summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-04-25 03:11:11 +0200
committerarchshift <admin@archshift.com>2014-04-25 03:11:11 +0200
commit624deea6c4f83f296c1bd1597e76b4704ffa4a9a (patch)
treeed589f25c11c91e7c8d5b9feee651bca11e2d2c3
parentRefactored SendChat(), placing the message-type formatting into its own function. (diff)
downloadcuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar.gz
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar.bz2
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar.lz
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar.xz
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.tar.zst
cuberite-624deea6c4f83f296c1bd1597e76b4704ffa4a9a.zip
-rw-r--r--src/Mobs/Monster.cpp17
-rw-r--r--src/Mobs/Monster.h2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index eb8480268..f68d2ef75 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -763,6 +763,7 @@ cMonster::eFamily cMonster::FamilyFromType(eType a_Type)
case mtCreeper: return mfHostile;
case mtEnderman: return mfHostile;
case mtGhast: return mfHostile;
+ case mtGiant: return mfHostile;
case mtHorse: return mfPassive;
case mtIronGolem: return mfPassive;
case mtMagmaCube: return mfHostile;
@@ -781,9 +782,11 @@ cMonster::eFamily cMonster::FamilyFromType(eType a_Type)
case mtWolf: return mfHostile;
case mtZombie: return mfHostile;
case mtZombiePigman: return mfHostile;
- } ;
+
+ case mtInvalidType: break;
+ }
ASSERT(!"Unhandled mob type");
- return mfMaxplusone;
+ return mfUnhandled;
}
@@ -794,10 +797,11 @@ int 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 mfHostile: return 40;
+ case mfPassive: return 40;
+ case mfAmbient: return 40;
+ case mfWater: return 400;
+ case mfUnhandled: break;
}
ASSERT(!"Unhandled mob family");
return -1;
@@ -866,6 +870,7 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType)
case mtEnderDragon: toReturn = new cEnderDragon(); break;
case mtEnderman: toReturn = new cEnderman(); break;
case mtGhast: toReturn = new cGhast(); break;
+ case mtGiant: toReturn = new cGiant(); break;
case mtIronGolem: toReturn = new cIronGolem(); break;
case mtMooshroom: toReturn = new cMooshroom(); break;
case mtOcelot: toReturn = new cOcelot(); break;
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 70b3783fc..0243f6637 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -66,7 +66,7 @@ public:
mfAmbient = 2, // Bats
mfWater = 3, // Squid
- mfMaxplusone, // Nothing. Be sure this is the last and the others are in order
+ mfUnhandled, // Nothing. Be sure this is the last and the others are in order
} ;
// tolua_end