summaryrefslogtreecommitdiffstats
path: root/src/control/AutoPilot.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-06-25 23:25:59 +0200
commitaf7573ddbe38e0aaa485877e7ccb2e704b0f5a7f (patch)
tree75a719bb1ab82b354f464562ecc1fae9c55f64d0 /src/control/AutoPilot.cpp
parentMerge pull request #1147 from withmorten/githash (diff)
downloadre3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.gz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.bz2
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.lz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.xz
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.tar.zst
re3-af7573ddbe38e0aaa485877e7ccb2e704b0f5a7f.zip
Diffstat (limited to 'src/control/AutoPilot.cpp')
-rw-r--r--src/control/AutoPilot.cpp54
1 files changed, 26 insertions, 28 deletions
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<int32>(buf);
+ m_nNextRouteNode = ReadSaveBuf<int32>(buf);
+ m_nPrevRouteNode = ReadSaveBuf<int32>(buf);
+ m_nTimeEnteredCurve = ReadSaveBuf<int32>(buf);
+ m_nTimeToSpendOnCurrentCurve = ReadSaveBuf<int32>(buf);
+ m_nCurrentPathNodeInfo = ReadSaveBuf<uint32>(buf);
+ m_nNextPathNodeInfo = ReadSaveBuf<uint32>(buf);
+ m_nPreviousPathNodeInfo = ReadSaveBuf<uint32>(buf);
+ m_nAntiReverseTimer = ReadSaveBuf<uint32>(buf);
+ m_nTimeToStartMission = ReadSaveBuf<uint32>(buf);
+ m_nPreviousDirection = ReadSaveBuf<int8>(buf);
+ m_nCurrentDirection = ReadSaveBuf<int8>(buf);
+ m_nNextDirection = ReadSaveBuf<int8>(buf);
+ m_nCurrentLane = ReadSaveBuf<int8>(buf);
+ m_nNextLane = ReadSaveBuf<int8>(buf);
+ m_nDrivingStyle = ReadSaveBuf<uint8>(buf);
+ m_nCarMission = ReadSaveBuf<uint8>(buf);
+ m_nTempAction = ReadSaveBuf<uint8>(buf);
+ m_nTimeTempAction = ReadSaveBuf<uint32>(buf);
+ m_fMaxTrafficSpeed = ReadSaveBuf<float>(buf);
+ m_nCruiseSpeed = ReadSaveBuf<uint8>(buf);
+ uint8 flags = ReadSaveBuf<uint8>(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<float>(buf);
+ m_vecDestinationCoors.y = ReadSaveBuf<float>(buf);
+ m_vecDestinationCoors.z = ReadSaveBuf<float>(buf);
SkipSaveBuf(buf, 32);
- ReadSaveBuf(&m_nPathFindNodesCount, buf);
+ m_nPathFindNodesCount = ReadSaveBuf<int16>(buf);
SkipSaveBuf(buf, 6);
}
#endif \ No newline at end of file