summaryrefslogtreecommitdiffstats
path: root/src/peds/PedStats.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-22 11:09:18 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-22 11:09:18 +0100
commit65e85587941101f8ae346a363b1594b63983417b (patch)
tree2cb412d78396b2fea57dd39f06d1a3af9cacb8d1 /src/peds/PedStats.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
parentMerge pull request #348 from erorcun/erorcun (diff)
downloadre3-65e85587941101f8ae346a363b1594b63983417b.tar
re3-65e85587941101f8ae346a363b1594b63983417b.tar.gz
re3-65e85587941101f8ae346a363b1594b63983417b.tar.bz2
re3-65e85587941101f8ae346a363b1594b63983417b.tar.lz
re3-65e85587941101f8ae346a363b1594b63983417b.tar.xz
re3-65e85587941101f8ae346a363b1594b63983417b.tar.zst
re3-65e85587941101f8ae346a363b1594b63983417b.zip
Diffstat (limited to 'src/peds/PedStats.cpp')
-rw-r--r--src/peds/PedStats.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/peds/PedStats.cpp b/src/peds/PedStats.cpp
index c393fddc..147f11e2 100644
--- a/src/peds/PedStats.cpp
+++ b/src/peds/PedStats.cpp
@@ -4,7 +4,8 @@
#include "FileMgr.h"
#include "PedStats.h"
-CPedStats *(&CPedStats::ms_apPedStats)[NUM_PEDSTATS] = *(CPedStats *(*)[NUM_PEDSTATS]) *(uintptr*)0x9404D4;
+//CPedStats *(&CPedStats::ms_apPedStats)[NUM_PEDSTATS] = *(CPedStats *(*)[NUM_PEDSTATS]) *(uintptr*)0x9404D4;
+CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS];
void
CPedStats::Initialise(void)
@@ -68,9 +69,9 @@ CPedStats::LoadPedStats(void)
line[linelen++] = ' ';
else
line[linelen++] = buf[bp];
- line[linelen] = '\0';
}
bp++;
+ line[linelen] = '\0';
// skip white space
for(lp = 0; line[lp] <= ' '; lp++);
@@ -107,14 +108,13 @@ CPedStats::LoadPedStats(void)
delete[] buf;
}
-int32
+ePedStats
CPedStats::GetPedStatType(char *name)
{
- int type;
-
- for(type = 0; type < NUM_PEDSTATS; type++)
+ for(uint16 type = 0; type < NUM_PEDSTATS; type++)
if(!CGeneral::faststrcmp(ms_apPedStats[type]->m_name, name))
- return type;
+ return (ePedStats) type;
+
return NUM_PEDSTATS;
}