From 43ce3dbf3da829635869d6a7a9c6688bc0b133e3 Mon Sep 17 00:00:00 2001 From: lemongrass3110 Date: Mon, 8 Apr 2013 02:05:27 +0000 Subject: 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 --- src/map/atcommand.c | 26 ++++++++++++++++++-------- 1 file 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; } } -- cgit v1.2.3-70-g09d2