summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-09 16:18:33 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-09 16:18:33 +0000
commit97ef7dfb68da9a3abccb78add4666c648c668884 (patch)
treede7d7a1a846b29d6ab03d373b5331699138e268d /src/map/pc.c
parent3e8fdb1e9d8591db80b24999595d2c70a004dce1 (diff)
downloadhercules-97ef7dfb68da9a3abccb78add4666c648c668884.tar.gz
hercules-97ef7dfb68da9a3abccb78add4666c648c668884.tar.bz2
hercules-97ef7dfb68da9a3abccb78add4666c648c668884.tar.xz
hercules-97ef7dfb68da9a3abccb78add4666c648c668884.zip
- pc_readdb will now cap experience required per level to UINT_MAX, it will warn the exp table has exp values above said limit.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5238 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 46fe462d8..66a14f9db 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -8047,10 +8047,22 @@ int pc_split_atoi(char *str,int *val, char sep, int max)
int pc_split_atoui(char *str,unsigned int *val, char sep, int max)
{
+ static int warning=0;
int i,j;
+ float f;
for (i=0; i<max; i++) {
if (!str) break;
- val[i] = (unsigned int)atof(str);
+ f = atof(str);
+ if (f < 0)
+ val[i] = 0;
+ else if (f > UINT_MAX) {
+ val[i] = UINT_MAX;
+ if (!warning) {
+ warning = 1;
+ ShowWarning("pc_readdb (exp.txt): Required exp per level is capped to %d\n", UINT_MAX);
+ }
+ } else
+ val[i] = (unsigned int)f;
str = strchr(str,sep);
if (str)
*str++=0;