summaryrefslogtreecommitdiffstats
path: root/source/Mobs
diff options
context:
space:
mode:
Diffstat (limited to 'source/Mobs')
-rw-r--r--source/Mobs/Cavespider.cpp2
-rw-r--r--source/Mobs/Enderman.cpp5
-rw-r--r--source/Mobs/Monster.cpp4
-rw-r--r--source/Mobs/Skeleton.cpp7
-rw-r--r--source/Mobs/Zombie.cpp5
-rw-r--r--source/Mobs/Zombiepigman.cpp5
6 files changed, 16 insertions, 12 deletions
diff --git a/source/Mobs/Cavespider.cpp b/source/Mobs/Cavespider.cpp
index b2188da3d..6c7ed0a7a 100644
--- a/source/Mobs/Cavespider.cpp
+++ b/source/Mobs/Cavespider.cpp
@@ -38,7 +38,7 @@ bool cCavespider::IsA( const char* a_EntityType )
void cCavespider::Tick(float a_Dt)
{
cMonster::Tick(a_Dt);
- m_EMPersonality = (GetWorld()->GetWorldTime() < (12000 + 1000) ) ? PASSIVE : AGGRESSIVE;
+ m_EMPersonality = (GetWorld()->GetTimeOfDay() < (12000 + 1000)) ? PASSIVE : AGGRESSIVE;
}
diff --git a/source/Mobs/Enderman.cpp b/source/Mobs/Enderman.cpp
index 36ee975b1..216fab85f 100644
--- a/source/Mobs/Enderman.cpp
+++ b/source/Mobs/Enderman.cpp
@@ -39,8 +39,9 @@ void cEnderman::Tick(float a_Dt)
{
cMonster::Tick(a_Dt);
- //TODO Same as stated in cSkeleton
- if (GetWorld()->GetWorldTime() < (12000 + 1000) && GetMetaData() != BURNING) { //if daylight
+ // TODO Same as stated in cSkeleton
+ if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && (GetMetaData() != BURNING))
+ {
SetMetaData(BURNING); // BURN, BABY, BURN! >:D
}
}
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index 6a5a2d667..82d69df57 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -217,12 +217,12 @@ void cMonster::ReplicateMovement()
float SqrDist = DiffX * DiffX + DiffY * DiffY + DiffZ * DiffZ;
if (
(SqrDist > 4 * 4) // 4 blocks is max Relative Move
- || (cWorld::GetTime() - m_TimeLastTeleportPacket > 2) // Send an absolute position every 2 seconds
+ || (m_World->GetWorldAge() - m_TimeLastTeleportPacket > 40) // Send an absolute position every 2 seconds
)
{
// LOGD("Teleported %f", sqrtf(SqrDist) );
m_World->BroadcastTeleportEntity(*this);
- m_TimeLastTeleportPacket = cWorld::GetTime();
+ m_TimeLastTeleportPacket = m_World->GetWorldAge();
}
else
{
diff --git a/source/Mobs/Skeleton.cpp b/source/Mobs/Skeleton.cpp
index 56bbb9310..b35cdb68e 100644
--- a/source/Mobs/Skeleton.cpp
+++ b/source/Mobs/Skeleton.cpp
@@ -39,9 +39,10 @@ void cSkeleton::Tick(float a_Dt)
{
cMonster::Tick(a_Dt);
- //TODO Outsource
- //TODO should do lightcheck, not daylight -> mobs in the dark donīt burn
- if (GetWorld()->GetWorldTime() < (12000 + 1000) && GetMetaData() != BURNING ) { //if daylight
+ // TODO Outsource
+ // TODO should do SkyLight check, mobs in the dark donīt burn
+ if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && (GetMetaData() != BURNING))
+ {
SetMetaData(BURNING); // BURN, BABY, BURN! >:D
}
}
diff --git a/source/Mobs/Zombie.cpp b/source/Mobs/Zombie.cpp
index b51931904..b0a429f25 100644
--- a/source/Mobs/Zombie.cpp
+++ b/source/Mobs/Zombie.cpp
@@ -39,8 +39,9 @@ void cZombie::Tick(float a_Dt)
{
cMonster::Tick(a_Dt);
- //TODO Same as in cSkeleton :D
- if (GetWorld()->GetWorldTime() < (12000 + 1000) && GetMetaData() != BURNING) { //if daylight
+ // TODO Same as in cSkeleton :D
+ if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && (GetMetaData() != BURNING))
+ {
SetMetaData(BURNING); // BURN, BABY, BURN! >:D
}
}
diff --git a/source/Mobs/Zombiepigman.cpp b/source/Mobs/Zombiepigman.cpp
index 65293cfce..a33d78efa 100644
--- a/source/Mobs/Zombiepigman.cpp
+++ b/source/Mobs/Zombiepigman.cpp
@@ -39,8 +39,9 @@ void cZombiepigman::Tick(float a_Dt)
{
cMonster::Tick(a_Dt);
- //TODO Same as noticed in cSkeleton AND Do they really burn by sun?? :D In the neather is no sun :D
- if (GetWorld()->GetWorldTime() < (12000 + 1000) && GetMetaData() != BURNING ) { //if daylight
+ // TODO Same as noticed in cSkeleton AND Do they really burn by sun?? :D In the neather is no sun :D
+ if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && (GetMetaData() != BURNING))
+ {
SetMetaData(BURNING); // BURN, BABY, BURN! >:D
}
}