mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-27 08:00:47 +00:00
refactor: deglob std::weak_ptr
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
TemptGoal::TemptGoal(PathfinderMob *mob, float speed, int itemId, bool canScare)
|
||||
{
|
||||
px = py = pz = pRotX = pRotY = 0.0;
|
||||
player = weak_ptr<Player>();
|
||||
player = std::<Player>();
|
||||
calmDown = 0;
|
||||
_isRunning = false;
|
||||
oldAvoidWater = false;
|
||||
@@ -28,7 +28,7 @@ bool TemptGoal::canUse()
|
||||
--calmDown;
|
||||
return false;
|
||||
}
|
||||
player = weak_ptr<Player>(mob->level->getNearestPlayer(mob->shared_from_this(), 10));
|
||||
player = std::<Player>(mob->level->getNearestPlayer(mob->shared_from_this(), 10));
|
||||
if (player.lock() == NULL) return false;
|
||||
mob->setDespawnProtected(); // If we've got a nearby player, then consider this mob as something we'd miss if it despawned
|
||||
std::shared_ptr<ItemInstance> item = player.lock()->getSelectedItem();
|
||||
@@ -71,7 +71,7 @@ void TemptGoal::start()
|
||||
|
||||
void TemptGoal::stop()
|
||||
{
|
||||
player = weak_ptr<Player>();
|
||||
player = std::<Player>();
|
||||
mob->getNavigation()->stop();
|
||||
calmDown = 100;
|
||||
_isRunning = false;
|
||||
|
||||
Reference in New Issue
Block a user