X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=SCX%2FParser.pm;h=080e8f21fdac67783ed87571e1a6b2b91f98e8f2;hb=4b09c7514e031aed3598d632c936641a0b7e6831;hp=b71f26b75639c01c8477bd68cc0b867c643cfa54;hpb=0bc768df52ed78631f048762071a3333e1030af5;p=slotcarman.git diff --git a/SCX/Parser.pm b/SCX/Parser.pm index b71f26b..080e8f2 100644 --- a/SCX/Parser.pm +++ b/SCX/Parser.pm @@ -185,9 +185,12 @@ sub car_lap_time_packet { || $bytes[5] & 0x01; $self->car_lap_time($bytes[0], - 256*$bytes[1] + $bytes[2] + ($bytes[3] & 0x01 ? 1 : 0), + 256*$bytes[1] + $bytes[2] + + ($bytes[3] & 0x02 ? 256 : 0) + + ($bytes[3] & 0x01 ? 1 : 0), sprintf('%.3f', 0.01024 * (256*$bytes[4] + $bytes[5] - + ($bytes[3] & 0x08 ? 1 : 0))), + + ($bytes[3] & 0x08 ? 256 : 0) + + ($bytes[3] & 0x04 ? 1 : 0))), sprintf('%04b', $bytes[3]) ); }