summaryrefslogtreecommitdiffstats
path: root/src/core/IniFile.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-08-15 04:06:52 +0200
committerGitHub <noreply@github.com>2019-08-15 04:06:52 +0200
commit6909fa283a25410a6d5f2fc93259b71770512ca2 (patch)
treecc187ba965eb71352fae028d3eb7f9f8db463153 /src/core/IniFile.cpp
parentCParticleObject done, cDMAudio done (diff)
parentMerge pull request #189 from Nick007J/master (diff)
downloadre3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.gz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.bz2
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.lz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.xz
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.tar.zst
re3-6909fa283a25410a6d5f2fc93259b71770512ca2.zip
Diffstat (limited to 'src/core/IniFile.cpp')
-rw-r--r--src/core/IniFile.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/IniFile.cpp b/src/core/IniFile.cpp
new file mode 100644
index 00000000..08b30876
--- /dev/null
+++ b/src/core/IniFile.cpp
@@ -0,0 +1,28 @@
+#include "common.h"
+#include "patcher.h"
+#include "IniFile.h"
+
+#include "CarCtrl.h"
+#include "FileMgr.h"
+#include "main.h"
+#include "Population.h"
+
+float &CIniFile::PedNumberMultiplier = *(float*)0x6182F4;
+float &CIniFile::CarNumberMultiplier = *(float*)0x6182F8;
+
+void CIniFile::LoadIniFile()
+{
+ CFileMgr::SetDir("");
+ int f = CFileMgr::OpenFile("gta3.ini", "r");
+ if (f){
+ CFileMgr::ReadLine(f, gString, 200);
+ sscanf(gString, "%f", &PedNumberMultiplier);
+ PedNumberMultiplier = min(3.0f, max(0.5f, PedNumberMultiplier));
+ CFileMgr::ReadLine(f, gString, 200);
+ sscanf(gString, "%f", &CarNumberMultiplier);
+ CarNumberMultiplier = min(3.0f, max(0.5f, CarNumberMultiplier));
+ CFileMgr::CloseFile(f);
+ }
+ CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier;
+ CCarCtrl::MaxNumberOfCarsInUse = 12.0f * CarNumberMultiplier;
+} \ No newline at end of file