summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorlemongrass3110 <lemongrass3110@54d463be-8e91-2dee-dedb-b68131a5f0ec>2013-04-08 02:05:27 +0000
committershennetsind <ind@henn.et>2013-04-11 16:41:06 -0300
commit43ce3dbf3da829635869d6a7a9c6688bc0b133e3 (patch)
tree028010423cd6187c4de6f1d424de0c3bd61b2225 /src/map/atcommand.c
parent119b35214f99e6e4df25e2a69b5fffd0cfe5e89c (diff)
downloadhercules-43ce3dbf3da829635869d6a7a9c6688bc0b133e3.tar.gz
hercules-43ce3dbf3da829635869d6a7a9c6688bc0b133e3.tar.bz2
hercules-43ce3dbf3da829635869d6a7a9c6688bc0b133e3.tar.xz
hercules-43ce3dbf3da829635869d6a7a9c6688bc0b133e3.zip
Speeded up jobchange command. Partially fixes bugreport:7453
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17235 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 777d777a2..bc76859e9 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1001,14 +1001,24 @@ ACMD_FUNC(jobchange)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d %d", &job, &upper) < 1) {
- int i, found = 0;
-
- for (i = JOB_NOVICE; i < JOB_MAX; ++i) {
- if (strncmpi(message, job_name(i), 16) == 0) {
- job = i;
- upper = 0;
- found = 1;
- break;
+ int i;
+ bool found = false;
+
+ upper = 0;
+
+ // Normal Jobs
+ for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ){
+ if (strncmpi(message, job_name(i), 16) == 0) {
+ job = i;
+ found = true;
+ }
+ }
+
+ // High Jobs, Babys and Third
+ for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){
+ if (strncmpi(message, job_name(i), 16) == 0) {
+ job = i;
+ found = true;
}
}