From aa173a454ceaa32b2bc752fa3648f06e64b90064 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 10 Oct 2019 17:18:19 +0300 Subject: Fix CCarGenerator Load/Save --- src/control/CarGen.cpp | 4 ++-- src/control/CarGen.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/control/CarGen.cpp b/src/control/CarGen.cpp index 9766467d..49a96f50 100644 --- a/src/control/CarGen.cpp +++ b/src/control/CarGen.cpp @@ -187,7 +187,7 @@ bool CCarGenerator::CheckIfWithinRangeOfAnyPlayer() return DotProduct2D(direction, FindPlayerSpeed()) <= 0; } -void CCarGenerator::Save(uint8 *buffer) +void CCarGenerator::Save(uint8 *&buffer) { WriteSaveBuf(buffer, m_nModelIndex); WriteSaveBuf(buffer, m_vecPos); @@ -214,7 +214,7 @@ void CCarGenerator::Save(uint8 *buffer) } -void CCarGenerator::Load(uint8 *buffer) +void CCarGenerator::Load(uint8 *&buffer) { m_nModelIndex = ReadSaveBuf(buffer); m_vecPos = ReadSaveBuf(buffer); diff --git a/src/control/CarGen.h b/src/control/CarGen.h index c1ca304c..75acdd56 100644 --- a/src/control/CarGen.h +++ b/src/control/CarGen.h @@ -34,8 +34,8 @@ public: void Setup(float x, float y, float z, float angle, int32 mi, int16 color1, int16 color2, uint8 force, uint8 alarm, uint8 lock, uint16 min_delay, uint16 max_delay); bool CheckForBlockage(); bool CheckIfWithinRangeOfAnyPlayer(); - void Save(uint8*); - void Load(uint8*); + void Save(uint8*&); + void Load(uint8*&); void SetUsesRemaining(uint16 uses) { m_nUsesRemaining = uses; } }; -- cgit v1.2.3