From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: 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. --- Minecraft.World/EntityDamageSource.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/EntityDamageSource.cpp') diff --git a/Minecraft.World/EntityDamageSource.cpp b/Minecraft.World/EntityDamageSource.cpp index 8c7a5ee1..266c867f 100644 --- a/Minecraft.World/EntityDamageSource.cpp +++ b/Minecraft.World/EntityDamageSource.cpp @@ -4,32 +4,32 @@ #include "net.minecraft.world.damagesource.h" #include "net.minecraft.network.packet.h" -//EntityDamageSource::EntityDamageSource(const wstring &msgId, shared_ptr entity) : DamageSource(msgId) -EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr entity) : DamageSource(msgId) +//EntityDamageSource::EntityDamageSource(const wstring &msgId, std::shared_ptr entity) : DamageSource(msgId) +EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity) : DamageSource(msgId) { this->entity = entity; } -shared_ptr EntityDamageSource::getEntity() +std::shared_ptr EntityDamageSource::getEntity() { return entity; } -//wstring EntityDamageSource::getLocalizedDeathMessage(shared_ptr player) +//wstring EntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name + entity->getAName(); // //return I18n.get("death." + msgId, player.name, entity.getAName()); //} -shared_ptr EntityDamageSource::getDeathMessagePacket(shared_ptr player) +std::shared_ptr EntityDamageSource::getDeathMessagePacket(std::shared_ptr player) { wstring additional = L""; if(entity->GetType() == eTYPE_SERVERPLAYER) { - shared_ptr sourcePlayer = dynamic_pointer_cast(entity); + std::shared_ptr sourcePlayer = dynamic_pointer_cast(entity); if(sourcePlayer != NULL) additional = sourcePlayer->name; } - return shared_ptr( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); + return std::shared_ptr( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); } bool EntityDamageSource::scalesWithDifficulty() -- cgit v1.2.3