summaryrefslogblamecommitdiffstats
path: root/src/core/IniFile.cpp
blob: 46dceff3795af60d628590228b85721f783fff6c (plain) (tree)


















                                                            
                                                                                

                                                            
                                                                                




                                                                        
#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;
}