diff options
author | Susu <susu-@live.fr> | 2013-05-17 11:10:30 +0200 |
---|---|---|
committer | Susu <susu-@live.fr> | 2013-05-17 11:10:30 +0200 |
commit | 25e848f1a0f9317d63106cae048a1ef838411cb2 (patch) | |
tree | 0c1dc751af9f06e1ce3729d271de301f78a4e611 /src/map/npc.c | |
parent | 3820bd7e7715bc84f458cf1bf466e6377a2d2e46 (diff) | |
download | hercules-25e848f1a0f9317d63106cae048a1ef838411cb2.tar.gz hercules-25e848f1a0f9317d63106cae048a1ef838411cb2.tar.bz2 hercules-25e848f1a0f9317d63106cae048a1ef838411cb2.tar.xz hercules-25e848f1a0f9317d63106cae048a1ef838411cb2.zip |
- Made DB and malloc lib HPM-friendly
- Also fixed a bug preventing the plugins to be loeaded because HPMI and HPMI_s weren't HPExport
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 77ee8d486..090c03e58 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -353,7 +353,7 @@ int npc_event_doall_sub(DBKey key, DBData *data, va_list ap) const char* name; int rid; - nullpo_ret(ev = db_data2ptr(data)); + nullpo_ret(ev = DB->data2ptr(data)); nullpo_ret(c = va_arg(ap, int *)); nullpo_ret(name = va_arg(ap, const char *)); rid = va_arg(ap, int); @@ -381,7 +381,7 @@ static int npc_event_do_sub(DBKey key, DBData *data, va_list ap) int* c; const char* name; - nullpo_ret(ev = db_data2ptr(data)); + nullpo_ret(ev = DB->data2ptr(data)); nullpo_ret(c = va_arg(ap, int *)); nullpo_ret(name = va_arg(ap, const char *)); @@ -1785,7 +1785,7 @@ int npc_remove_map(struct npc_data* nd) */ static int npc_unload_ev(DBKey key, DBData *data, va_list ap) { - struct event_data* ev = db_data2ptr(data); + struct event_data* ev = DB->data2ptr(data); char* npcname = va_arg(ap, char *); if(strcmp(ev->nd->exname,npcname)==0){ @@ -2302,7 +2302,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const int npc_convertlabel_db(DBKey key, DBData *data, va_list ap) { const char* lname = (const char*)key.str; - int lpos = db_data2i(data); + int lpos = DB->data2i(data); struct npc_label_list** label_list; int* label_list_num; const char* filepath; @@ -2972,9 +2972,9 @@ static const char* npc_parse_function(char* w1, char* w2, char* w3, char* w4, co return end; func_db = script_get_userfunc_db(); - if (func_db->put(func_db, db_str2key(w3), db_ptr2data(script), &old_data)) + if (func_db->put(func_db, DB->str2key(w3), DB->ptr2data(script), &old_data)) { - struct script_code *oldscript = (struct script_code*)db_data2ptr(&old_data); + struct script_code *oldscript = (struct script_code*)DB->data2ptr(&old_data); ShowInfo("npc_parse_function: Overwriting user function [%s] (%s:%d)\n", w3, filepath, strline(buffer,start-buffer)); script_free_vars(oldscript->script_vars); aFree(oldscript->script_buf); @@ -3776,7 +3776,7 @@ void npc_read_event_script(void) for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { const char* p = key.str; - struct event_data* ed = db_data2ptr(data); + struct event_data* ed = DB->data2ptr(data); unsigned char count = script_event[i].event_count; if( count >= ARRAYLENGTH(script_event[i].event) ) |