1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-10 21:29:16 +00:00
re3/src/core/IniFile.cpp

28 lines
839 B
C++
Raw Normal View History

2019-08-06 21:32:19 +00:00
#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;
}