Skip to content

Commit 939283d

Browse files
Fix positioning of multitarget struct in pipelineresult unpack (#1181)
fixed the unpacking order to match the current pipelineresult data layout. * fix positioning of multitarget struct in pipelineresult unpack * fix encode order in PhotonPipelineResult.cpp
1 parent 43338a4 commit 939283d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

photon-targeting/src/main/native/cpp/photon/targeting/PhotonPipelineResult.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ bool PhotonPipelineResult::operator==(const PhotonPipelineResult& other) const {
3737

3838
Packet& operator<<(Packet& packet, const PhotonPipelineResult& result) {
3939
// Encode latency and number of targets.
40-
packet << result.latency.value() << result.multitagResult
40+
packet << result.latency.value()
4141
<< static_cast<int8_t>(result.targets.size());
4242

4343
// Encode the information of each target.
4444
for (auto& target : result.targets) packet << target;
4545

46+
packet << result.multitagResult;
4647
// Return the packet
4748
return packet;
4849
}
@@ -51,7 +52,7 @@ Packet& operator>>(Packet& packet, PhotonPipelineResult& result) {
5152
// Decode latency, existence of targets, and number of targets.
5253
double latencyMillis = 0;
5354
int8_t targetCount = 0;
54-
packet >> latencyMillis >> result.multitagResult >> targetCount;
55+
packet >> latencyMillis >> targetCount;
5556
result.latency = units::millisecond_t(latencyMillis);
5657

5758
result.targets.clear();
@@ -62,6 +63,8 @@ Packet& operator>>(Packet& packet, PhotonPipelineResult& result) {
6263
packet >> target;
6364
result.targets.push_back(target);
6465
}
66+
67+
packet >> result.multitagResult;
6568
return packet;
6669
}
6770
} // namespace photon

0 commit comments

Comments
 (0)