summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-22 23:03:12 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-22 23:03:12 +0100
commitc884edd923a20e2fdf697bb7101039c812c6db25 (patch)
treea5352c5ef5e7f7359af907428d3fc23c653e5357 /src/control/Script.cpp
parentfix (diff)
downloadre3-c884edd923a20e2fdf697bb7101039c812c6db25.tar
re3-c884edd923a20e2fdf697bb7101039c812c6db25.tar.gz
re3-c884edd923a20e2fdf697bb7101039c812c6db25.tar.bz2
re3-c884edd923a20e2fdf697bb7101039c812c6db25.tar.lz
re3-c884edd923a20e2fdf697bb7101039c812c6db25.tar.xz
re3-c884edd923a20e2fdf697bb7101039c812c6db25.tar.zst
re3-c884edd923a20e2fdf697bb7101039c812c6db25.zip
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index a9df5799..ca94527f 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -49,7 +49,7 @@
#include "Timecycle.h"
#include "TxdStore.h"
#include "Bike.h"
-#include "memoryManager.h"
+#include "smallHeap.h"
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#include <stdarg.h>
#endif
@@ -2632,7 +2632,8 @@ bool CTheScripts::Init(bool loaddata)
CFileMgr::Read(mainf, (char*)&MainScriptSize, sizeof(MainScriptSize));
int nLargestMissionSize = 0;
CFileMgr::Read(mainf, (char*)&nLargestMissionSize, sizeof(nLargestMissionSize));
- // some cSmallHeap shit - TODO
+ if (!cSmallHeap::msInstance.IsLocked())
+ cSmallHeap::msInstance.Lock();
ScriptSpace = (uint8*)base::cMainMemoryManager::Instance()->Allocate(MainScriptSize + nLargestMissionSize);
memset(ScriptSpace, 0, MainScriptSize + nLargestMissionSize);
CFileMgr::Read(mainf, (char*)ScriptSpace, MainScriptSize);