Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafradek committed May 24, 2024
1 parent 91d1f1d commit 2d9b499
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mod/perf/sendprop_optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,6 @@ namespace Mod::Perf::SendProp_Optimize

for (int i = 0; i < packWorkTaskCount; i++) {
threadPoolPackWork.push_task([&](int num){
entitiesWithNotUpdatedChangedProps[num].reserve(8);
entitiesWithNotUpdatedFullyChangedProps[num].reserve(2);
size_t workEntryCount = snapshot->m_nValidEntities/packWorkTaskCount+1;
PackWork_t *workEntities = (PackWork_t *) operator new[](workEntryCount * sizeof(PackWork_t));
size_t workEntitiesCount = 0;
Expand All @@ -1297,9 +1295,9 @@ namespace Mod::Perf::SendProp_Optimize
&& snapmgr.UsePreviouslySentPacket(snapshot, idx, edict->m_NetworkSerialNumber)) {

if (edict->m_fStateFlags & FL_FULL_EDICT_CHANGED)
entitiesWithNotUpdatedFullyChangedProps->push_back(edict);
entitiesWithNotUpdatedFullyChangedProps[num].push_back(edict);
else if (edict->m_fStateFlags & FL_EDICT_CHANGED)
entitiesWithNotUpdatedChangedProps->push_back(edict);
entitiesWithNotUpdatedChangedProps[num].push_back(edict);
continue;
}
PackWork_t &work = workEntities[workEntitiesCount++];
Expand Down Expand Up @@ -1374,6 +1372,9 @@ namespace Mod::Perf::SendProp_Optimize
}
}

delete entitiesWithNotUpdatedChangedProps;
delete entitiesWithNotUpdatedFullyChangedProps;

threadPool.wait_for_tasks();
threadPoolPackWork.wait_for_tasks();

Expand Down

0 comments on commit 2d9b499

Please sign in to comment.