diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-22 10:39:13 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-22 10:39:13 +0100 |
commit | aebe130299a3c3d14a0d89e68195c303ca120c1b (patch) | |
tree | 7f4342e9556da307c1ebea5b802961c4f60f79d5 /source/Mobs/Monster.cpp | |
parent | Fixed linux compilation (diff) | |
download | cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar.gz cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar.bz2 cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar.lz cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar.xz cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.tar.zst cuberite-aebe130299a3c3d14a0d89e68195c303ca120c1b.zip |
Diffstat (limited to 'source/Mobs/Monster.cpp')
-rw-r--r-- | source/Mobs/Monster.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp index 04989caac..49f11ebfd 100644 --- a/source/Mobs/Monster.cpp +++ b/source/Mobs/Monster.cpp @@ -16,19 +16,13 @@ #include "../Vector3d.h" #include "../Tracer.h" -#include "../../iniFile/iniFile.h" +// #include "../../iniFile/iniFile.h" -/* -#ifndef _WIN32 - #include <unistd.h> -#endif -*/ - -cMonster::cMonster(void) +cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) : super(etMob) , m_Target(NULL) , m_bMovingToDestination(false) @@ -37,9 +31,9 @@ cMonster::cMonster(void) , m_bOnGround( false ) , m_DestroyTimer( 0 ) , m_Jump(0) - , m_MobType( 0 ) - , m_SoundHurt( "" ) - , m_SoundDeath( "" ) + , m_MobType(a_ProtocolMobType) + , m_SoundHurt(a_SoundHurt) + , m_SoundDeath(a_SoundDeath) , m_EMState(IDLE) , m_SightDistance(25) , m_SeePlayerInterval (0) @@ -50,11 +44,10 @@ cMonster::cMonster(void) , m_AttackRate(3) , idle_interval(0) { - LOGD("cMonster::cMonster()"); - LOGD("In state: %s", GetState()); - - m_bBurnable = true; - m_MetaData = NORMAL; + if (!a_ConfigName.empty()) + { + GetMonsterConfig(a_ConfigName); + } } @@ -520,9 +513,9 @@ cPlayer * cMonster::FindClosestPlayer(void) -void cMonster::GetMonsterConfig(const char* pm_name) +void cMonster::GetMonsterConfig(const AString & a_Name) { - cRoot::Get()->GetMonsterConfig()->AssignAttributes(this, pm_name); + cRoot::Get()->GetMonsterConfig()->AssignAttributes(this, a_Name); } |