1
0

Moved all MobTypesManager functions to cMonster.

This removes some of the memory leaks and is more logical in structure. Also the functions are exported to Lua.
This commit is contained in:
madmaxoft
2013-10-20 13:25:56 +02:00
parent 359918127b
commit 848d061de1
9 changed files with 352 additions and 299 deletions

View File

@@ -2,8 +2,6 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "MobSpawner.h"
#include "MobTypesManager.h"
#include "Mobs/Monster.h"
#include "Mobs/IncludeAllMonsters.h"
cMobSpawner::tMobTypes& cMobSpawner::m_MobTypes()
@@ -57,7 +55,7 @@ cMobSpawner::cMobSpawner(cMonster::eFamily a_MonsterFamily,const std::set<cMonst
{
for (std::set<cMonster::eType>::const_iterator itr = a_AllowedTypes.begin(); itr != a_AllowedTypes.end(); itr++)
{
if (cMobTypesManager::FamilyFromType(*itr) == a_MonsterFamily)
if (cMonster::FamilyFromType(*itr) == a_MonsterFamily)
{
m_AllowedTypes.insert(*itr);
}
@@ -256,7 +254,7 @@ cMonster* cMobSpawner::TryToSpawnHere(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockM
if (CanSpawnHere(m_MobType, a_BlockType, a_BlockMeta, a_BlockType_below, a_BlockMeta_below, a_BlockType_above, a_BlockMeta_above, a_Biome, a_Level))
{
cMonster* newMob = cMobTypesManager::NewMonsterFromType(m_MobType);
cMonster * newMob = cMonster::NewMonsterFromType(m_MobType);
if (newMob)
{
m_Spawned.insert(newMob);