Skip to content

Commit

Permalink
Interactive: Use range-based for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dscharrer committed Aug 14, 2021
1 parent ec3900e commit fc70d68
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/scene/Interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,18 +750,13 @@ static void ARX_INTERACTIVE_ClearIODynData_II(Entity * io) {
g_secondaryInventoryHud.clear(io);

if(io->inventory != nullptr) {
INVENTORY_DATA * id = io->inventory;

for(long nj = 0; nj < id->m_size.y; nj++) {
for(long ni = 0; ni < id->m_size.x; ni++) {
if(id->slot[ni][nj].io) {
id->slot[ni][nj].io->destroy();
}
arx_assert(id->slot[ni][nj].io == nullptr);
arx_assert(id->slot[ni][nj].show == false);
for(auto slot : io->inventory->slots()) {
if(slot.entity) {
slot.entity->destroy();
}
arx_assert(slot.entity == nullptr);
arx_assert(slot.show == false);
}

delete io->inventory;
io->inventory = nullptr;
}
Expand Down

0 comments on commit fc70d68

Please sign in to comment.