diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/BoatItem.cpp | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (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/BoatItem.cpp')
| -rw-r--r-- | Minecraft.World/BoatItem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/BoatItem.cpp b/Minecraft.World/BoatItem.cpp index 3499bc02..af778350 100644 --- a/Minecraft.World/BoatItem.cpp +++ b/Minecraft.World/BoatItem.cpp @@ -12,7 +12,7 @@ BoatItem::BoatItem(int id) : Item( id ) this->maxStackSize = 1; } -bool BoatItem::TestUse(Level *level, shared_ptr<Player> player) +bool BoatItem::TestUse(Level *level, std::shared_ptr<Player> player) { // 4J-PB - added for tooltips to test use // 4J TODO really we should have the crosshair hitresult telling us if it hit water, and at what distance, so we don't need to do this again @@ -49,7 +49,7 @@ bool BoatItem::TestUse(Level *level, shared_ptr<Player> player) delete hr; return false; } -shared_ptr<ItemInstance> BoatItem::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player) +std::shared_ptr<ItemInstance> BoatItem::use(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player) { float a = 1; @@ -80,11 +80,11 @@ shared_ptr<ItemInstance> BoatItem::use(shared_ptr<ItemInstance> itemInstance, Le Vec3 *b = player->getViewVector(a); bool hitEntity = false; float overlap = 1; - vector<shared_ptr<Entity> > *objects = level->getEntities(player, player->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); + vector<std::shared_ptr<Entity> > *objects = level->getEntities(player, player->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); //for (int i = 0; i < objects.size(); i++) { for(AUTO_VAR(it, objects->begin()); it != objects->end(); ++it) { - shared_ptr<Entity> e = *it; //objects.get(i); + std::shared_ptr<Entity> e = *it; //objects.get(i); if (!e->isPickable()) continue; float rr = e->getPickRadius(); @@ -105,12 +105,12 @@ shared_ptr<ItemInstance> BoatItem::use(shared_ptr<ItemInstance> itemInstance, Le int yt = hr->y; int zt = hr->z; - if (!level->isClientSide) + if (!level->isClientSide) { if (level->getTile(xt, yt, zt) == Tile::topSnow_Id) yt--; if( level->countInstanceOf(eTYPE_BOAT, true) < Level::MAX_XBOX_BOATS ) // 4J - added limit { - level->addEntity( shared_ptr<Boat>( new Boat(level, xt + 0.5f, yt + 1.0f, zt + 0.5f) ) ); + level->addEntity( std::shared_ptr<Boat>( new Boat(level, xt + 0.5f, yt + 1.0f, zt + 0.5f) ) ); if (!player->abilities.instabuild) { itemInstance->count--; |
