Your code has some really bad practice, inserting 10000 rows in that vector for every call to function make unecessary lag (use if (x >=xr && y <= yr)), however your code should look more like this
#ifdef ENABLE_BLOCK_DROP_MAP
if (is_drop_item(GetMapIndex())){
Reward(false);}
else
{
Reward(true);
}
}
#else
Reward(true);
}
#endif
to
#ifdef ENABLE_BLOCK_DROP_MAP
bool bIsRewardItem = is_drop_item(GetDungeon() ? (GetDungeon()->GetMapIndex() / 10000) : GetMapIndex());
Reward(!bIsRewardItem);
#else
Reward(true);
}
#endif
and
bool is_drop_item(int map_index)
{
const std::unordered_set<int> DropMap{41};
return DropMap.find(map_index) != DropMap.end();
}
(Didn't tested but should work)
Take it as an advice, hf.