Skip to content

Commit b876feb

Browse files
committed
a shallow copy of NPCs for tick
1 parent 1408d65 commit b876feb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Server/Components/NPCs/npcs_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ void NPCComponent::onTick(Microseconds elapsed, TimePoint now)
128128
// Clean this pool because it is now processed
129129
markedForKick.clear();
130130

131-
for (auto& npc : storage)
131+
auto shallowCopy = storage._entries();
132+
for (auto& npc : shallowCopy)
132133
{
133134
static_cast<NPC*>(npc)->tick(elapsed, now);
134135
}

0 commit comments

Comments
 (0)