summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-09 20:30:02 +0100
committerHaru <haru@dotalux.com>2013-12-01 13:20:44 +0100
commitc6c2ad187c386d8d27d3336dcbdd5a92555493d2 (patch)
tree2feeb3847e42db2e6d35fa48c9893db933f35723 /src/map/npc.c
parent49d2dff6314486758832cad3403e1775c3fd7af3 (diff)
downloadhercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.gz
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.bz2
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.xz
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.zip
Changed variables, labels, functions, commands to case sensitive.
- Fixes bugreport:7810, thanks to Wend, kyeme, evilpuncker, jaBote, and various other people I may be forgetting to mention http://hercules.ws/board/tracker/issue-7810-disguise-script-command - Due to the nature of this change, I'm leaving the deprecation messages lingering around for a while more (as errors rather than warnings), to make sure they won't pass unnoticed, in case you haven't yet updated your custom scripts to comply with this. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 8d71ee20a..d82bbdfd9 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3749,14 +3749,15 @@ void npc_read_event_script(void)
break;
}
- if( (p=strchr(p,':')) && p && strcmpi(name,p)==0 )
+ if( (p=strchr(p,':')) && strcmp(name,p) == 0 )
{
-#ifdef ENABLE_CASE_CHECK
- if( strcmp(name, p) != 0 ) DeprecationWarning2("npc_read_event_script", p, name, config[i].event_name); // TODO
-#endif // ENABLE_CASE_CHECK
script_event[i].event[count] = ed;
script_event[i].event_name[count] = key.str;
script_event[i].event_count++;
+#ifdef ENABLE_CASE_CHECK
+ } else if( p && strcasecmp(name, p) == 0 ) {
+ DeprecationWarning2("npc_read_event_script", p, name, config[i].event_name); // TODO
+#endif // ENABLE_CASE_CHECK
}
}
dbi_destroy(iter);
@@ -3902,7 +3903,7 @@ bool npc_unloadfile( const char* filepath ) {
bool found = false;
for( nd = dbi_first(iter); dbi_exists(iter); nd = dbi_next(iter) ) {
- if( nd->path && strcasecmp(nd->path,filepath) == 0 ) {
+ if( nd->path && strcasecmp(nd->path,filepath) == 0 ) { // FIXME: This can break in case-sensitive file systems
found = true;
npc->unload_duplicates(nd);/* unload any npcs which could duplicate this but be in a different file */
npc->unload(nd, true);
@@ -3994,8 +3995,8 @@ int do_init_npc(bool minimal) {
for( i = MAX_NPC_CLASS2_START; i < MAX_NPC_CLASS2_END; i++ )
npc_viewdb2[i - MAX_NPC_CLASS2_START].class_ = i;
- npc->ev_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, EVENT_NAME_LENGTH);
- npc->ev_label_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, NAME_LENGTH);
+ npc->ev_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, EVENT_NAME_LENGTH);
+ npc->ev_label_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, NAME_LENGTH);
npc->name_db = strdb_alloc(DB_OPT_BASE, NAME_LENGTH);
npc->path_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, 0);