summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2022-07-11 00:56:25 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2022-07-19 23:33:09 +0200
commit284f54ed81186d3122b994db7395e870703efb4f (patch)
tree51a4b5c4a7e9fdde460c84117ea8f9ea6ed97393 /src/Mobs
parentMove LineBlockTracer into Physics (diff)
downloadcuberite-284f54ed81186d3122b994db7395e870703efb4f.tar
cuberite-284f54ed81186d3122b994db7395e870703efb4f.tar.gz
cuberite-284f54ed81186d3122b994db7395e870703efb4f.tar.bz2
cuberite-284f54ed81186d3122b994db7395e870703efb4f.tar.lz
cuberite-284f54ed81186d3122b994db7395e870703efb4f.tar.xz
cuberite-284f54ed81186d3122b994db7395e870703efb4f.tar.zst
cuberite-284f54ed81186d3122b994db7395e870703efb4f.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/AggressiveMonster.cpp6
-rw-r--r--src/Mobs/Enderman.cpp4
-rw-r--r--src/Mobs/Monster.cpp6
-rw-r--r--src/Mobs/Zombie.cpp1
-rw-r--r--src/Mobs/ZombieVillager.cpp1
5 files changed, 8 insertions, 10 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp
index f7392d92e..a2a9274c8 100644
--- a/src/Mobs/AggressiveMonster.cpp
+++ b/src/Mobs/AggressiveMonster.cpp
@@ -5,7 +5,7 @@
#include "../World.h"
#include "../Entities/Player.h"
-#include "../LineBlockTracer.h"
+#include "../Physics/Tracers/LineBlockTracer.h"
@@ -68,11 +68,11 @@ void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
if (
(GetTarget() != nullptr) &&
TargetIsInRange() &&
- cLineBlockTracer::LineOfSightTrace(
+ LineBlockTracer::LineOfSightTrace(
*GetWorld(),
GetPosition().addedY(GetHeight()),
GetTarget()->GetPosition().addedY(GetTarget()->GetHeight()),
- (IsNetherNative() ? cLineBlockTracer::losAirWaterLava : cLineBlockTracer::losAirWater)
+ (IsNetherNative() ? LineBlockTracer::LineOfSight::AirWaterLava : LineBlockTracer::LineOfSight::AirWater)
) &&
(GetHealth() > 0.0)
)
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index 656668fb3..66e23b8db 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -4,7 +4,7 @@
#include "Chunk.h"
#include "Enderman.h"
#include "../Entities/Player.h"
-#include "../LineBlockTracer.h"
+#include "../Physics/Tracers/LineBlockTracer.h"
@@ -55,7 +55,7 @@ public:
}
// TODO: Check if endermen are angered through water in Vanilla
- if (!cLineBlockTracer::LineOfSightTrace(*a_Player.GetWorld(), m_EndermanHeadPosition, PlayerHeadPosition, cLineBlockTracer::losAirWater))
+ if (!LineBlockTracer::LineOfSightTrace(*a_Player.GetWorld(), m_EndermanHeadPosition, PlayerHeadPosition, LineBlockTracer::LineOfSight::AirWater))
{
// No direct line of sight
return false;
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 8e0d3a179..54b7319a4 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -2,7 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "IncludeAllMonsters.h"
-#include "LineBlockTracer.h"
+#include "Physics/Tracers/LineBlockTracer.h"
#include "../BlockInfo.h"
#include "../Root.h"
#include "../Server.h"
@@ -754,7 +754,7 @@ void cMonster::CheckEventSeePlayer(cChunk & a_Chunk)
// TODO: Currently all mobs see through lava, but only Nether-native mobs should be able to.
if (
(TargetDistance < ClosestDistance) &&
- cLineBlockTracer::LineOfSightTrace(*GetWorld(), MyHeadPosition, TargetHeadPosition, cLineBlockTracer::losAirWaterLava)
+ LineBlockTracer::LineOfSightTrace(*GetWorld(), MyHeadPosition, TargetHeadPosition, LineBlockTracer::LineOfSight::AirWaterLava)
)
{
TargetPlayer = &a_Player;
@@ -800,7 +800,7 @@ void cMonster::CheckEventLostPlayer(const std::chrono::milliseconds a_Dt)
const auto MyHeadPosition = GetPosition().addedY(GetHeight());
const auto TargetHeadPosition = Target->GetPosition().addedY(Target->GetHeight());
- if (!cLineBlockTracer::LineOfSightTrace(*GetWorld(), MyHeadPosition, TargetHeadPosition, cLineBlockTracer::losAirWaterLava))
+ if (!LineBlockTracer::LineOfSightTrace(*GetWorld(), MyHeadPosition, TargetHeadPosition, LineBlockTracer::LineOfSight::AirWaterLava))
{
if ((m_LoseSightAbandonTargetTimer += a_Dt) > std::chrono::seconds(4))
{
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index 09e39a14b..e517b338b 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -3,7 +3,6 @@
#include "Zombie.h"
#include "../World.h"
-#include "../LineBlockTracer.h"
diff --git a/src/Mobs/ZombieVillager.cpp b/src/Mobs/ZombieVillager.cpp
index cde099947..d91619cd4 100644
--- a/src/Mobs/ZombieVillager.cpp
+++ b/src/Mobs/ZombieVillager.cpp
@@ -3,7 +3,6 @@
#include "ZombieVillager.h"
#include "../World.h"
-#include "../LineBlockTracer.h"
#include "../Entities/Player.h"