• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android [SOLVED] Problem importing purchase price from Google Play

S

Schekhovtsov

Guest
Hello. The following error periodically occurs:

if GPBilling_IsStoreConnected()
{
var _m = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[2]);
var _c = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[2]);
var _val = string(_m / 1000000);

p_price_val[0] = _val;
p_price_sym[0] = _c;

var _m2 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[3]);
var _c2 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[3]);
var _val2 = string(_m2 / 1000000);

p_price_val[1] = _val2;
p_price_sym[1] = _c2;

var _m3 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[4]);
var _c3 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[4]);
var _val3 = string(_m3 / 1000000);

p_price_val[2] = _val3;
p_price_sym[2] = _c3;

var _m4 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[5]);
var _c4 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[5]);
var _val4 = string(_m4 / 1000000);

p_price_val[3] = _val4;
p_price_sym[3] = _c4;
}

Does anyone know the reason and how to avoid the error?
 

FrostyCat

Redemption Seeker
The DoDiv in the error message tells you something wrong is going into those division operators. Check out the values from those m variables in the debugger and look for abnormalities there.
 
S

Schekhovtsov

Guest
Solved: We found out that the error occurred in the absence of the Internet. They added the condition that if there is no Internet, do not download data (prices) from Google Play
 
Top