mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-19 18:18:08 +00:00
refactor: unglob std::shared_ptr
This commit is contained in:
@@ -977,7 +977,7 @@ bool Minecraft::addLocalPlayer(int idx)
|
||||
if(success)
|
||||
{
|
||||
app.DebugPrintf("Adding temp local player on pad %d\n", idx);
|
||||
localplayers[idx] = shared_ptr<MultiplayerLocalPlayer>( new MultiplayerLocalPlayer(this, level, user, NULL ) );
|
||||
localplayers[idx] = std::shared_ptr<MultiplayerLocalPlayer>( new MultiplayerLocalPlayer(this, level, user, NULL ) );
|
||||
localgameModes[idx] = NULL;
|
||||
|
||||
updatePlayerViewportAssignments();
|
||||
@@ -1025,7 +1025,7 @@ void Minecraft::addPendingLocalConnection(int idx, ClientConnection *connection)
|
||||
m_pendingLocalConnections[idx] = connection;
|
||||
}
|
||||
|
||||
shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin)
|
||||
std::shared_ptr<MultiplayerLocalPlayer> Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin)
|
||||
{
|
||||
if( clientConnection == NULL) return nullptr;
|
||||
|
||||
@@ -1141,7 +1141,7 @@ void Minecraft::removeLocalPlayerIdx(int idx)
|
||||
{
|
||||
if( getLevel( localplayers[idx]->dimension )->isClientSide )
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[idx];
|
||||
std::shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[idx];
|
||||
( (MultiPlayerLevel *)getLevel( localplayers[idx]->dimension ) )->removeClientConnection(mplp->connection, true);
|
||||
delete mplp->connection;
|
||||
mplp->connection = NULL;
|
||||
@@ -1163,7 +1163,7 @@ void Minecraft::removeLocalPlayerIdx(int idx)
|
||||
}
|
||||
else if( m_pendingLocalConnections[idx] != NULL )
|
||||
{
|
||||
m_pendingLocalConnections[idx]->sendAndDisconnect( shared_ptr<DisconnectPacket>( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );;
|
||||
m_pendingLocalConnections[idx]->sendAndDisconnect( std::shared_ptr<DisconnectPacket>( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );;
|
||||
delete m_pendingLocalConnections[idx];
|
||||
m_pendingLocalConnections[idx] = NULL;
|
||||
g_NetworkManager.RemoveLocalPlayerByUserIndex(idx);
|
||||
@@ -1584,7 +1584,7 @@ void Minecraft::run_middle()
|
||||
else
|
||||
{
|
||||
// create the localplayer
|
||||
shared_ptr<Player> player = localplayers[i];
|
||||
std::shared_ptr<Player> player = localplayers[i];
|
||||
if( player == NULL)
|
||||
{
|
||||
player = createExtraLocalPlayer(i, (convStringToWstring( ProfileManager.GetGamertag(i) )).c_str(), i, level->dimension->id);
|
||||
@@ -1800,7 +1800,7 @@ void Minecraft::run_middle()
|
||||
// if (pause) timer.a = 1;
|
||||
|
||||
PIXBeginNamedEvent(0,"Sound engine update");
|
||||
soundEngine->tick((shared_ptr<Mob> *)localplayers, timer->a);
|
||||
soundEngine->tick((std::shared_ptr<Mob> *)localplayers, timer->a);
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0,"Light update");
|
||||
@@ -2345,7 +2345,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
else
|
||||
{
|
||||
// no hit result, but we may have something in our hand that we can do something with
|
||||
shared_ptr<ItemInstance> itemInstance = player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> itemInstance = player->inventory->getSelected();
|
||||
|
||||
// 4J-JEV: Moved all this here to avoid having it in 3 different places.
|
||||
if (itemInstance)
|
||||
@@ -2716,14 +2716,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
// is there an object in hand?
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
switch(iID)
|
||||
{
|
||||
default:
|
||||
{
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
|
||||
if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem))
|
||||
{
|
||||
@@ -2740,7 +2740,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
// is there an object in hand?
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
// It's an item
|
||||
@@ -2752,7 +2752,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
|
||||
if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem))
|
||||
{
|
||||
@@ -2769,7 +2769,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
{
|
||||
if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT;
|
||||
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
// It's an item
|
||||
@@ -2783,13 +2783,13 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
case Item::shears_Id:
|
||||
{
|
||||
if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT;
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
if(!animal->isBaby()) *piUse=IDS_TOOLTIPS_SHEAR;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
|
||||
if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem))
|
||||
{
|
||||
@@ -2842,7 +2842,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
// is there an object in hand?
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
if(iID==Item::coal->id)
|
||||
@@ -2864,14 +2864,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT;
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
switch(iID)
|
||||
{
|
||||
case Item::dye_powder_Id:
|
||||
{
|
||||
shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(hitResult->entity);
|
||||
std::shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(hitResult->entity);
|
||||
// convert to tile-based color value (0 is white instead of black)
|
||||
int newColor = ClothTile::getTileDataForItemAuxValue(heldItem->getAuxValue());
|
||||
|
||||
@@ -2884,7 +2884,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
case Item::shears_Id:
|
||||
{
|
||||
shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(hitResult->entity);
|
||||
std::shared_ptr<Sheep> sheep = dynamic_pointer_cast<Sheep>(hitResult->entity);
|
||||
|
||||
// can only shear a sheep that hasn't been sheared
|
||||
if(!sheep->isSheared() )
|
||||
@@ -2896,7 +2896,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
|
||||
if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem))
|
||||
{
|
||||
@@ -2926,7 +2926,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
{
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> heldItem=player->inventory->getSelected();
|
||||
int iID=heldItem->getItem()->id;
|
||||
|
||||
switch(iID)
|
||||
@@ -2936,7 +2936,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
std::shared_ptr<Animal> animal = dynamic_pointer_cast<Animal>(hitResult->entity);
|
||||
|
||||
if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem))
|
||||
{
|
||||
@@ -2954,8 +2954,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
// can be tamed, fed, and made to sit/stand, or enter love mode
|
||||
{
|
||||
int iID=-1;
|
||||
shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
shared_ptr<Wolf> wolf = dynamic_pointer_cast<Wolf>(hitResult->entity);
|
||||
std::shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
std::shared_ptr<Wolf> wolf = dynamic_pointer_cast<Wolf>(hitResult->entity);
|
||||
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
@@ -3044,8 +3044,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
case eTYPE_OZELOT:
|
||||
{
|
||||
int iID=-1;
|
||||
shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
shared_ptr<Ozelot> ocelot = dynamic_pointer_cast<Ozelot>(hitResult->entity);
|
||||
std::shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
std::shared_ptr<Ozelot> ocelot = dynamic_pointer_cast<Ozelot>(hitResult->entity);
|
||||
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
@@ -3106,7 +3106,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
case eTYPE_PLAYER:
|
||||
{
|
||||
// Fix for #58576 - TU6: Content: Gameplay: Hit button prompt is available when attacking a host who has "Invisible" option turned on
|
||||
shared_ptr<Player> TargetPlayer = dynamic_pointer_cast<Player>(hitResult->entity);
|
||||
std::shared_ptr<Player> TargetPlayer = dynamic_pointer_cast<Player>(hitResult->entity);
|
||||
|
||||
if(!TargetPlayer->hasInvisiblePrivilege()) // This means they are invisible, not just that they have the privilege
|
||||
{
|
||||
@@ -3119,7 +3119,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
case eTYPE_ITEM_FRAME:
|
||||
{
|
||||
shared_ptr<ItemFrame> itemFrame = dynamic_pointer_cast<ItemFrame>(hitResult->entity);
|
||||
std::shared_ptr<ItemFrame> itemFrame = dynamic_pointer_cast<ItemFrame>(hitResult->entity);
|
||||
|
||||
// is the frame occupied?
|
||||
if(itemFrame->getItem()!=NULL)
|
||||
@@ -3141,7 +3141,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
case eTYPE_VILLAGER:
|
||||
{
|
||||
shared_ptr<Villager> villager = dynamic_pointer_cast<Villager>(hitResult->entity);
|
||||
std::shared_ptr<Villager> villager = dynamic_pointer_cast<Villager>(hitResult->entity);
|
||||
if (!villager->isBaby())
|
||||
{
|
||||
*piUse=IDS_TOOLTIPS_TRADE;
|
||||
@@ -3151,8 +3151,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
break;
|
||||
case eTYPE_ZOMBIE:
|
||||
{
|
||||
shared_ptr<Zombie> zomb = dynamic_pointer_cast<Zombie>(hitResult->entity);
|
||||
shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
std::shared_ptr<Zombie> zomb = dynamic_pointer_cast<Zombie>(hitResult->entity);
|
||||
std::shared_ptr<ItemInstance> heldItem=nullptr;
|
||||
|
||||
if(player->inventory->IsHeldItem())
|
||||
{
|
||||
@@ -3337,9 +3337,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
|
||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_SPAWN_CREEPER)) && app.GetMobsDontAttackEnabled())
|
||||
{
|
||||
//shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Creeper::_class->newInstance( level ));
|
||||
//shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Wolf::_class->newInstance( level ));
|
||||
shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(shared_ptr<Spider>(new Spider( level )));
|
||||
//std::shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Creeper::_class->newInstance( level ));
|
||||
//std::shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Wolf::_class->newInstance( level ));
|
||||
std::shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(std::shared_ptr<Spider>(new Spider( level )));
|
||||
mob->moveTo(player->x+1, player->y, player->z+1, level->random->nextFloat() * 360, 0);
|
||||
level->addEntity(mob);
|
||||
}
|
||||
@@ -3369,14 +3369,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
|
||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_INVENTORY)) && gameMode->isInputAllowed(MINECRAFT_ACTION_INVENTORY))
|
||||
{
|
||||
shared_ptr<LocalPlayer> player = dynamic_pointer_cast<LocalPlayer>( Minecraft::GetInstance()->player );
|
||||
std::shared_ptr<LocalPlayer> player = dynamic_pointer_cast<LocalPlayer>( Minecraft::GetInstance()->player );
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
app.LoadInventoryMenu(iPad,player);
|
||||
}
|
||||
|
||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_CRAFTING)) && gameMode->isInputAllowed(MINECRAFT_ACTION_CRAFTING))
|
||||
{
|
||||
shared_ptr<LocalPlayer> player = dynamic_pointer_cast<LocalPlayer>( Minecraft::GetInstance()->player );
|
||||
std::shared_ptr<LocalPlayer> player = dynamic_pointer_cast<LocalPlayer>( Minecraft::GetInstance()->player );
|
||||
|
||||
// 4J-PB - reordered the if statement so creative mode doesn't bring up the crafting table
|
||||
// Fix for #39014 - TU5: Creative Mode: Pressing X to access the creative menu while looking at a crafting table causes the crafting menu to display
|
||||
@@ -3440,7 +3440,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) )
|
||||
{
|
||||
wstring itemName = L"";
|
||||
shared_ptr<ItemInstance> selectedItem = player->getSelectedItem();
|
||||
std::shared_ptr<ItemInstance> selectedItem = player->getSelectedItem();
|
||||
// Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item
|
||||
int iCount=0;
|
||||
|
||||
@@ -3708,7 +3708,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
setLocalPlayerIdx(idx);
|
||||
gameRenderer->setupCamera(timer->a, i);
|
||||
Camera::prepare(localplayers[idx], localplayers[idx]->ThirdPersonView() == 2);
|
||||
shared_ptr<Mob> cameraEntity = cameraTargetPlayer;
|
||||
std::shared_ptr<Mob> cameraEntity = cameraTargetPlayer;
|
||||
double xOff = cameraEntity->xOld + (cameraEntity->x - cameraEntity->xOld) * timer->a;
|
||||
double yOff = cameraEntity->yOld + (cameraEntity->y - cameraEntity->yOld) * timer->a;
|
||||
double zOff = cameraEntity->zOld + (cameraEntity->z - cameraEntity->zOld) * timer->a;
|
||||
@@ -3834,7 +3834,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension)
|
||||
//}
|
||||
|
||||
// Also causing ambiguous call for some reason
|
||||
// as it is matching shared_ptr<Player> from the func below with bool from this one
|
||||
// as it is matching std::shared_ptr<Player> from the func below with bool from this one
|
||||
//void Minecraft::setLevel(Level *level, const wstring& message, bool doForceStatsSave /*= true*/)
|
||||
//{
|
||||
// setLevel(level, message, NULL, doForceStatsSave);
|
||||
@@ -3848,7 +3848,7 @@ void Minecraft::forceaddLevel(MultiPlayerLevel *level)
|
||||
else levels[0] = level;
|
||||
}
|
||||
|
||||
void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_ptr<Player> forceInsertPlayer /*=NULL*/, bool doForceStatsSave /*=true*/, bool bPrimaryPlayerSignedOut /*=false*/)
|
||||
void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, std::shared_ptr<Player> forceInsertPlayer /*=NULL*/, bool doForceStatsSave /*=true*/, bool bPrimaryPlayerSignedOut /*=false*/)
|
||||
{
|
||||
EnterCriticalSection(&m_setLevelCS);
|
||||
bool playerAdded = false;
|
||||
@@ -3913,7 +3913,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt
|
||||
// Delete all the player objects
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[idx];
|
||||
std::shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[idx];
|
||||
if(mplp != NULL && mplp->connection != NULL )
|
||||
{
|
||||
delete mplp->connection;
|
||||
@@ -4160,7 +4160,7 @@ wstring Minecraft::gatherStats4()
|
||||
void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId)
|
||||
{
|
||||
gameRenderer->DisableUpdateThread(); // 4J - don't do updating whilst we are adjusting the player & localplayer array
|
||||
shared_ptr<MultiplayerLocalPlayer> localPlayer = localplayers[iPad];
|
||||
std::shared_ptr<MultiplayerLocalPlayer> localPlayer = localplayers[iPad];
|
||||
|
||||
level->validateSpawn();
|
||||
level->removeAllPendingEntityRemovals();
|
||||
@@ -4171,7 +4171,7 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId)
|
||||
level->removeEntity(localPlayer);
|
||||
}
|
||||
|
||||
shared_ptr<Player> oldPlayer = localPlayer;
|
||||
std::shared_ptr<Player> oldPlayer = localPlayer;
|
||||
cameraTargetPlayer = nullptr;
|
||||
|
||||
// 4J-PB - copy and set the players xbox pad
|
||||
@@ -4559,7 +4559,7 @@ bool mayUse = true;
|
||||
|
||||
if(button==1 && (player->isSleeping() && level != NULL && level->isClientSide))
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> mplp = dynamic_pointer_cast<MultiplayerLocalPlayer>( player );
|
||||
std::shared_ptr<MultiplayerLocalPlayer> mplp = dynamic_pointer_cast<MultiplayerLocalPlayer>( player );
|
||||
|
||||
if(mplp) mplp->StopSleeping();
|
||||
|
||||
@@ -4608,7 +4608,7 @@ gameMode->startDestroyBlock(x, y, z, hitResult->f);
|
||||
}
|
||||
else
|
||||
{
|
||||
shared_ptr<ItemInstance> item = player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> item = player->inventory->getSelected();
|
||||
int oldCount = item != NULL ? item->count : 0;
|
||||
if (gameMode->useItemOn(player, level, item, x, y, z, face))
|
||||
{
|
||||
@@ -4634,7 +4634,7 @@ gameRenderer->itemInHandRenderer->itemPlaced();
|
||||
|
||||
if (mayUse && button == 1)
|
||||
{
|
||||
shared_ptr<ItemInstance> item = player->inventory->getSelected();
|
||||
std::shared_ptr<ItemInstance> item = player->inventory->getSelected();
|
||||
if (item != NULL)
|
||||
{
|
||||
if (gameMode->useItem(player, level, item))
|
||||
@@ -4721,7 +4721,7 @@ void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasP
|
||||
else if( ProfileManager.IsSignedInLive(iPad) && ProfileManager.AllowedToPlayMultiplayer(iPad) )
|
||||
{
|
||||
// create the local player for the iPad
|
||||
shared_ptr<Player> player = pClass->localplayers[iPad];
|
||||
std::shared_ptr<Player> player = pClass->localplayers[iPad];
|
||||
if( player == NULL)
|
||||
{
|
||||
if( pClass->level->isClientSide )
|
||||
@@ -4731,7 +4731,7 @@ void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasP
|
||||
else
|
||||
{
|
||||
// create the local player for the iPad
|
||||
shared_ptr<Player> player = pClass->localplayers[iPad];
|
||||
std::shared_ptr<Player> player = pClass->localplayers[iPad];
|
||||
if( player == NULL)
|
||||
{
|
||||
player = pClass->createExtraLocalPlayer(iPad, (convStringToWstring( ProfileManager.GetGamertag(iPad) )).c_str(), iPad, pClass->level->dimension->id);
|
||||
@@ -4802,7 +4802,7 @@ int Minecraft::InGame_SignInReturned(void *pParam,bool bContinue, int iPad)
|
||||
else
|
||||
{
|
||||
// create the local player for the iPad
|
||||
shared_ptr<Player> player = pMinecraftClass->localplayers[iPad];
|
||||
std::shared_ptr<Player> player = pMinecraftClass->localplayers[iPad];
|
||||
if( player == NULL)
|
||||
{
|
||||
player = pMinecraftClass->createExtraLocalPlayer(iPad, (convStringToWstring( ProfileManager.GetGamertag(iPad) )).c_str(), iPad, pMinecraftClass->level->dimension->id);
|
||||
@@ -4831,7 +4831,7 @@ void Minecraft::tickAllConnections()
|
||||
int oldIdx = getLocalPlayerIdx();
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++ )
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[i];
|
||||
std::shared_ptr<MultiplayerLocalPlayer> mplp = localplayers[i];
|
||||
if( mplp && mplp->connection)
|
||||
{
|
||||
setLocalPlayerIdx(i);
|
||||
|
||||
Reference in New Issue
Block a user