mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Fix potentially expensive copying of ChunkPos in escort path assignment
This commit is contained in:
parent
5c1bb0acc9
commit
e5d9e7217e
@ -361,7 +361,7 @@ static void taskStart(CNSocket* sock, CNPacketData* data) {
|
|||||||
|
|
||||||
// if escort task, assign matching paths to all nearby NPCs
|
// if escort task, assign matching paths to all nearby NPCs
|
||||||
if (task["m_iHTaskType"] == 6) {
|
if (task["m_iHTaskType"] == 6) {
|
||||||
for (ChunkPos chunkPos : Chunking::getChunksInMap(plr->instanceID)) { // check all NPCs in the instance
|
for (ChunkPos& chunkPos : Chunking::getChunksInMap(plr->instanceID)) { // check all NPCs in the instance
|
||||||
Chunk* chunk = Chunking::chunks[chunkPos];
|
Chunk* chunk = Chunking::chunks[chunkPos];
|
||||||
for (EntityRef ref : chunk->entities) {
|
for (EntityRef ref : chunk->entities) {
|
||||||
if (ref.type != EntityType::PLAYER) {
|
if (ref.type != EntityType::PLAYER) {
|
||||||
|
Loading…
Reference in New Issue
Block a user