This commit is contained in:
root
2024-04-24 10:25:44 +08:00
parent 627bf43ee3
commit 248388a322
5271 changed files with 3753425 additions and 803 deletions

View File

@@ -47,14 +47,13 @@ public:
bool get_rand_cera_shop_bonus_item(CeraShopBonusItemType* res = NULL)
{
int size = get_random_item_num();
for (int i = 0; i < size; i++)
int rand_ = Utils::Rand(0, get_random_item_num() - 1);
int i = 0;
for (auto it = cera_shop_bonus_item_map_rand.Begin(); it != cera_shop_bonus_item_map_rand.End(); it++, i++)
{
int random_value = Utils::Rand(1, size - 1);
CeraShopBonusItemType cera_shop_bonusi_temt = cera_shop_bonus_item_map_rand.Map.at(random_value);
if (cera_shop_bonusi_temt.is_random == true)
if (rand_ == i)
{
if (res != NULL) *res = cera_shop_bonusi_temt;
if (res) *res = it->second;
return true;
}
}