Skip to content

Commit

Permalink
Merge pull request #6 from leroythelegend/fix-record-lap-txt
Browse files Browse the repository at this point in the history
Prevent random values from being included in csv file.
  • Loading branch information
leroythelegend authored Sep 15, 2021
2 parents 0d5a822 + b260631 commit 7f45d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0.0)
project(risf12021 VERSION 0.1.0)
project(risf12021 VERSION 1.0.4)

set(CMAKE_CXX_STANDARD 17)
set(THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down
8 changes: 8 additions & 0 deletions src/processcartelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ namespace ris
{
PacketCarTelemetryData packet(b);
size_t playerindex = static_cast<size_t>(packet.packets(PacketHeader::PACKETHEADER).at(0)->telemetry(PacketHeader::PLAYERCARINDEX).at(0));

// there seems to be a glitch where I'm getting odd values
if ((packet.packets(PacketCarTelemetryData::CarTelemetry::CARTELEMETRY).at(playerindex)->telemetry(PacketCarTelemetryData::CarTelemetry::DRS).at(0) != 0) &&
(packet.packets(PacketCarTelemetryData::CarTelemetry::CARTELEMETRY).at(playerindex)->telemetry(PacketCarTelemetryData::CarTelemetry::DRS).at(0) != 1))
{
break;
}

telemetry.packets.push_back(packet.packets(PacketCarTelemetryData::CarTelemetry::CARTELEMETRY).at(playerindex));
telemetry.packets.push_back(packet.packets(PacketCarTelemetryData::CarTelemetryData::CARTELEMETRYDATA).at(0));
}
Expand Down

0 comments on commit 7f45d55

Please sign in to comment.