Fix switch warnings (#4013)

* Fix switch warnings
  * Fix a variety of -Wswitch and -Wswitch-enum warnings
  * Remove unneeded -Wno-error flags

* Reorganise some eMonsterType switches
  * Alpha sort eMonsterType cases in WriteMobMetadata
    and in cNBTChunkSerializer::AddMonsterEntity
  * List all mob types in protocol 1.12 and NBTChunkSerializer

* cStructGenTrees::GetNumTrees: remove switch default

* cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
This commit is contained in:
peterbell10
2017-09-14 09:48:57 +01:00
committed by Alexander Harkness
parent e24186bb13
commit 307e7aaff5
24 changed files with 357 additions and 322 deletions
+10 -6
View File
@@ -1034,10 +1034,12 @@ cMonster::eFamily cMonster::FamilyFromType(eMonsterType a_Type)
case mtZombie: return mfHostile;
case mtZombiePigman: return mfHostile;
case mtInvalidType: break;
default:
{
ASSERT(!"Unhandled mob type");
return mfUnhandled;
}
}
ASSERT(!"Unhandled mob type");
return mfUnhandled;
}
@@ -1053,10 +1055,12 @@ int cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily)
case mfAmbient: return 40;
case mfWater: return 400;
case mfNoSpawn: return -1;
case mfUnhandled: break;
default:
{
ASSERT(!"Unhandled mob family");
return -1;
}
}
ASSERT(!"Unhandled mob family");
return -1;
}