aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Spider.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/Spider.cpp
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff)
shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
Diffstat (limited to 'Minecraft.World/Spider.cpp')
-rw-r--r--Minecraft.World/Spider.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/Spider.cpp b/Minecraft.World/Spider.cpp
index ba58ce54..a80543e4 100644
--- a/Minecraft.World/Spider.cpp
+++ b/Minecraft.World/Spider.cpp
@@ -61,13 +61,13 @@ bool Spider::makeStepSound()
return false;
}
-shared_ptr<Entity> Spider::findAttackTarget()
+std::shared_ptr<Entity> Spider::findAttackTarget()
{
#ifndef _FINAL_BUILD
#ifdef _DEBUG_MENUS_ENABLED
if(app.GetMobsDontAttackEnabled())
{
- return shared_ptr<Player>();
+ return std::shared_ptr<Player>();
}
#endif
#endif
@@ -78,7 +78,7 @@ shared_ptr<Entity> Spider::findAttackTarget()
double maxDist = 16;
return level->getNearestAttackablePlayer(shared_from_this(), maxDist);
}
- return shared_ptr<Entity>();
+ return std::shared_ptr<Entity>();
}
int Spider::getAmbientSound()
@@ -96,7 +96,7 @@ int Spider::getDeathSound()
return eSoundType_MOB_SPIDER_DEATH;
}
-void Spider::checkHurtTarget(shared_ptr<Entity> target, float d)
+void Spider::checkHurtTarget(std::shared_ptr<Entity> target, float d)
{
float br = getBrightness(1);
if (br > 0.5f && random->nextInt(100) == 0)
@@ -107,7 +107,7 @@ void Spider::checkHurtTarget(shared_ptr<Entity> target, float d)
if (d > 2 && d < 6 && random->nextInt(10) == 0)
{
- if (onGround)
+ if (onGround)
{
double xdd = target->x - x;
double zdd = target->z - z;
@@ -116,7 +116,7 @@ void Spider::checkHurtTarget(shared_ptr<Entity> target, float d)
zd = (zdd / dd * 0.5f) * 0.8f + zd * 0.2f;
yd = 0.4f;
}
- }
+ }
else
{
Monster::checkHurtTarget(target, d);
@@ -143,11 +143,11 @@ void Spider::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel)
* to climb walls.
*/
-bool Spider::onLadder()
+bool Spider::onLadder()
{
return isClimbing();
}
-
+
void Spider::makeStuckInWeb()
{
// do nothing - spiders don't get stuck in web