Add missed lines allocation

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis
2025-03-17 01:13:21 +02:00
parent 809a9009a3
commit b81c638921
2 changed files with 10 additions and 2 deletions

View File

@@ -52,6 +52,10 @@
#include "Wanted.h"
#include "SaveBuf.h"
void* obj_alloc(size_t size, void** storage);
void obj_free(void* ptr);
void* obj_move(void* ptr);
bool bAllCarCheat;
RwObject *GetCurrentAtomicObjectCB(RwObject *object, void *data);
@@ -194,7 +198,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
CColModel *colModel = mi->GetColModel();
if(colModel->lines == nil){
colModel->lines = (CColLine*)RwMalloc(4*sizeof(CColLine));
colModel->lines = (CColLine*)obj_alloc(4*sizeof(CColLine), (void**)&colModel->lines);
colModel->numLines = 4;
}

View File

@@ -38,6 +38,10 @@
#include "Debug.h"
#include "SaveBuf.h"
void* obj_alloc(size_t size, void** storage);
void obj_free(void* ptr);
void* obj_move(void* ptr);
const uint32 CBike::nSaveStructSize =
#ifdef COMPATIBLE_SAVES
1260;
@@ -163,7 +167,7 @@ CBike::CBike(int32 id, uint8 CreatedBy)
CColModel *colModel = mi->GetColModel();
if(colModel->lines == nil){
colModel->lines = (CColLine*)RwMalloc(4*sizeof(CColLine));
colModel->lines = (CColLine*)obj_alloc(4*sizeof(CColLine), (void**)&colModel->lines);
colModel->numLines = 4;
}
// BUG? this would make more sense in the if above