From af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f Mon Sep 17 00:00:00 2001 From: erorcun Date: Sat, 26 Jun 2021 00:25:59 +0300 Subject: Revert "Redo ReadSaveBuf + common.h cleanup" This reverts commit 2b67aba94cb6448fb24c869559465eddf2bad069. --- src/control/AutoPilot.cpp | 54 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src/control/AutoPilot.cpp') diff --git a/src/control/AutoPilot.cpp b/src/control/AutoPilot.cpp index 22a73179..77cbd0b4 100644 --- a/src/control/AutoPilot.cpp +++ b/src/control/AutoPilot.cpp @@ -5,7 +5,6 @@ #include "CarCtrl.h" #include "Curves.h" #include "PathFind.h" -#include "SaveBuf.h" void CAutoPilot::ModifySpeed(float speed) { @@ -89,40 +88,39 @@ void CAutoPilot::Save(uint8*& buf) void CAutoPilot::Load(uint8*& buf) { - ReadSaveBuf(&m_nCurrentRouteNode, buf); - ReadSaveBuf(&m_nNextRouteNode, buf); - ReadSaveBuf(&m_nPrevRouteNode, buf); - ReadSaveBuf(&m_nTimeEnteredCurve, buf); - ReadSaveBuf(&m_nTimeToSpendOnCurrentCurve, buf); - ReadSaveBuf(&m_nCurrentPathNodeInfo, buf); - ReadSaveBuf(&m_nNextPathNodeInfo, buf); - ReadSaveBuf(&m_nPreviousPathNodeInfo, buf); - ReadSaveBuf(&m_nAntiReverseTimer, buf); - ReadSaveBuf(&m_nTimeToStartMission, buf); - ReadSaveBuf(&m_nPreviousDirection, buf); - ReadSaveBuf(&m_nCurrentDirection, buf); - ReadSaveBuf(&m_nNextDirection, buf); - ReadSaveBuf(&m_nCurrentLane, buf); - ReadSaveBuf(&m_nNextLane, buf); - ReadSaveBuf(&m_nDrivingStyle, buf); - ReadSaveBuf(&m_nCarMission, buf); - ReadSaveBuf(&m_nTempAction, buf); - ReadSaveBuf(&m_nTimeTempAction, buf); - ReadSaveBuf(&m_fMaxTrafficSpeed, buf); - ReadSaveBuf(&m_nCruiseSpeed, buf); - uint8 flags; - ReadSaveBuf(&flags, buf); + m_nCurrentRouteNode = ReadSaveBuf(buf); + m_nNextRouteNode = ReadSaveBuf(buf); + m_nPrevRouteNode = ReadSaveBuf(buf); + m_nTimeEnteredCurve = ReadSaveBuf(buf); + m_nTimeToSpendOnCurrentCurve = ReadSaveBuf(buf); + m_nCurrentPathNodeInfo = ReadSaveBuf(buf); + m_nNextPathNodeInfo = ReadSaveBuf(buf); + m_nPreviousPathNodeInfo = ReadSaveBuf(buf); + m_nAntiReverseTimer = ReadSaveBuf(buf); + m_nTimeToStartMission = ReadSaveBuf(buf); + m_nPreviousDirection = ReadSaveBuf(buf); + m_nCurrentDirection = ReadSaveBuf(buf); + m_nNextDirection = ReadSaveBuf(buf); + m_nCurrentLane = ReadSaveBuf(buf); + m_nNextLane = ReadSaveBuf(buf); + m_nDrivingStyle = ReadSaveBuf(buf); + m_nCarMission = ReadSaveBuf(buf); + m_nTempAction = ReadSaveBuf(buf); + m_nTimeTempAction = ReadSaveBuf(buf); + m_fMaxTrafficSpeed = ReadSaveBuf(buf); + m_nCruiseSpeed = ReadSaveBuf(buf); + uint8 flags = ReadSaveBuf(buf); m_bSlowedDownBecauseOfCars = !!(flags & BIT(0)); m_bSlowedDownBecauseOfPeds = !!(flags & BIT(1)); m_bStayInCurrentLevel = !!(flags & BIT(2)); m_bStayInFastLane = !!(flags & BIT(3)); m_bIgnorePathfinding = !!(flags & BIT(4)); SkipSaveBuf(buf, 2); - ReadSaveBuf(&m_vecDestinationCoors.x, buf); - ReadSaveBuf(&m_vecDestinationCoors.y, buf); - ReadSaveBuf(&m_vecDestinationCoors.z, buf); + m_vecDestinationCoors.x = ReadSaveBuf(buf); + m_vecDestinationCoors.y = ReadSaveBuf(buf); + m_vecDestinationCoors.z = ReadSaveBuf(buf); SkipSaveBuf(buf, 32); - ReadSaveBuf(&m_nPathFindNodesCount, buf); + m_nPathFindNodesCount = ReadSaveBuf(buf); SkipSaveBuf(buf, 6); } #endif \ No newline at end of file -- cgit v1.2.3