fixed vita startup crash by guarding commerce calls

This commit is contained in:
552eden
2026-08-05 00:39:26 +03:00
parent de8bf25fbe
commit 43878b9103
6 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -4419,7 +4419,7 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto
// 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus
#ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon();
#endif
app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus);
@@ -56,7 +56,7 @@ void CPlatformNetworkManagerSony::HandleStateChange(SQRNetworkManager::eSQRNetwo
// 4J Stu - We may be accepting an invite from the DLC menu, so hide the icon
#ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon();
#endif
m_bLeavingGame = false;
@@ -100,7 +100,7 @@ void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat, bool press
{
#ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon();
#endif
navigateBack();
@@ -174,7 +174,7 @@ int UIScene_DLCMainMenu::ExitDLCMainMenu(void *pParam,int iPad,C4JStorage::EMess
#ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon();
#endif
pClass->navigateBack();
@@ -107,7 +107,7 @@ int UIScene_DLCOffersMenu::ExitDLCOffersMenu(void *pParam,int iPad,C4JStorage::E
#ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon();
#endif
ui.NavigateToHomeMenu();//iPad,eUIScene_MainMenu);
+2 -1
View File
@@ -46,6 +46,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
m_pSaveToDelete = NULL;
m_pCheckoutProductInfo = NULL;
m_pCommerce = NULL;
}
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId)
@@ -1080,7 +1081,7 @@ void CConsoleMinecraftApp::AppEventTick()
bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
{
#ifdef VITA_COMMERCE
#ifdef VITA_COMMERCE_ENABLED
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
bool bEmptyStore=true;
@@ -665,7 +665,9 @@ int main()
app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL
// 4J-PB - Kick of the check for trial or full version - requires ui to be initialised
#ifndef DISABLE_PSN
app.GetCommerce()->CheckForTrialUpgradeKey();
#endif