summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-15 21:04:57 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-15 21:04:57 +0300
commitc4a3fd1133cea06a1716ae81d9c5cf8b7f1ddb8b (patch)
treece2941e18d6dff40cecb78fa5d91982e53554752 /src/char/char.c
parent6c520b880e31c4ce281999ad6bdb80bd6bbd6634 (diff)
downloadevol-hercules-c4a3fd1133cea06a1716ae81d9c5cf8b7f1ddb8b.tar.gz
evol-hercules-c4a3fd1133cea06a1716ae81d9c5cf8b7f1ddb8b.tar.bz2
evol-hercules-c4a3fd1133cea06a1716ae81d9c5cf8b7f1ddb8b.tar.xz
evol-hercules-c4a3fd1133cea06a1716ae81d9c5cf8b7f1ddb8b.zip
char: validate player look value on char creation.
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 38c5f42..b0328c6 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -59,6 +59,13 @@ void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd)
return;
}
look = RFIFOW(fd, 34);
+ if (look < min_look || look > max_look)
+ {
+ chr->creation_failed(fd, -12);
+ RFIFOSKIP(fd, 31 + 5);
+ hookStop();
+ return;
+ }
}
const int result = chr->make_new_char_sql(sd, (char*)RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29));
@@ -110,6 +117,7 @@ void echar_creation_failed(int *fdPtr, int *result)
case -5: WFIFOB(fd, 2) = 0x02; break; // 'Symbols in Character Names are forbidden'
case -10: WFIFOB(fd, 2) = 0x50; break; // Wrong class
case -11: WFIFOB(fd, 2) = 0x51; break; // Wrong sex
+ case -12: WFIFOB(fd, 2) = 0x52; break; // Wrong look
default:
ShowWarning("chr->parse_char: Unknown result received from chr->make_new_char_sql: %d!\n", *result);