diff options
author | Haru <haru@dotalux.com> | 2013-12-04 20:11:10 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-12-04 21:00:48 +0100 |
commit | 43462caf9441a041755806a889cb6d5104dcf438 (patch) | |
tree | cf1e86d12b4c788238a7c3290a50cea76642f21c /src/map/mob.c | |
parent | 48fdd76b45f6c37cc02a5f981d3591c951ddfb94 (diff) | |
download | hercules-43462caf9441a041755806a889cb6d5104dcf438.tar.gz hercules-43462caf9441a041755806a889cb6d5104dcf438.tar.bz2 hercules-43462caf9441a041755806a889cb6d5104dcf438.tar.xz hercules-43462caf9441a041755806a889cb6d5104dcf438.zip |
Follow-up to 6e9c385b8fa2fbca97ca23e35f0b8e5dabd13526
- Case-sensitive AegisName and Sprite ID lookups are now optional,
controlled by the case_sensitive_aegisnames battle config flag (you
can set it to "no" to restore the case insensitive behavior.)
- Special thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 92fa98885..8bb0ebe65 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -95,7 +95,11 @@ int mobdb_searchname(const char *str) monster = mob->db(i); if(monster == mob->dummy) //Skip dummy mobs. continue; - if(strcmpi(monster->name,str)==0 || strcmpi(monster->jname,str)==0 || strcmp(monster->sprite,str)==0) // Sprite name case sensitive + if(strcmpi(monster->name,str)==0 || strcmpi(monster->jname,str)==0) + return i; + if(battle_config.case_sensitive_aegisnames && strcmp(monster->sprite,str)==0) + return i; + if(!battle_config.case_sensitive_aegisnames && strcasecmp(monster->sprite,str)==0) return i; } @@ -106,18 +110,20 @@ int mobdb_searchname_array_sub(struct mob_db* monster, const char *str, int flag return 1; if(!monster->base_exp && !monster->job_exp && monster->spawn[0].qty < 1) return 1; // Monsters with no base/job exp and no spawn point are, by this criteria, considered "slave mobs" and excluded from search results - if( !flag ){ + if( !flag ) { if(stristr(monster->jname,str)) return 0; if(stristr(monster->name,str)) return 0; - return strcmpi(monster->jname,str); + } else { + if(strcmpi(monster->jname,str) == 0) + return 0; + if(strcmpi(monster->name,str) == 0) + return 0; } - if(strcmpi(monster->jname,str) == 0) - return 0; - if(strcmpi(monster->name,str) == 0) - return 0; - return strcmp(monster->sprite,str); + if (battle_config.case_sensitive_aegisnames) + return strcmp(monster->sprite,str); + return strcasecmp(monster->sprite,str); } /*========================================== |