- Joined
- Jul 14, 2025
- Messages
- 134
- Reaction score
- 1,098
- Points
- 93
- Discord
- jigsaw86
Replace
With
What does it do?
- Previously, an item was created just to check if it was stackable and it remained in memory.
Code:
LPITEM item = ITEM_MANAGER::instance().CreateItem(materialInfo.reward.vnum, materialInfo.reward.count);
if (item->IsStackable() && !IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK)){
pack.date_cube_renewal.item_reward_stackable = true;
}else{
pack.date_cube_renewal.item_reward_stackable = false;
}
With
Code:
auto item = ITEM_MANAGER::instance().GetTable(materialInfo.reward.vnum);
if (!item)
{
sys_err("%s: unknown material vnum (reward vnum %u) (category %s)", ch->GetName(), materialInfo.reward.vnum, materialInfo.category.c_str());
continue;
}
pack.date_cube_renewal.item_reward_stackable = IS_SET(item->dwFlags, ITEM_FLAG_STACKABLE) && !IS_SET(item->dwAntiFlags, ITEM_ANTIFLAG_STACK);
What does it do?
- Previously, an item was created just to check if it was stackable and it remained in memory.