diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/map/script.c b/src/map/script.c index 031dfc21b..3ed779fba 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -767,6 +767,7 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom) char null_arg = '\0'; int func; + // is need add check for arg null pointer below? func = script->add_word(p); if( script->str_data[func].type == C_FUNC ) { // buildin function @@ -2593,10 +2594,11 @@ void* get_val2(struct script_state* st, int64 uid, struct reg_db *ref) { **/ void script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref) { const char *name = script->get_str(script_getvarid(uid)); + // is here st can be null pointer and st->rid is wrong? struct reg_db *src = script->array_src(st, sd ? sd : st->rid ? map->id2sd(st->rid) : NULL, name, ref); struct script_array *sa = NULL; bool insert = false; - + if( sd && !st ) /* when sd comes, st isn't available */ insert = true; else { @@ -4385,7 +4387,7 @@ void do_final_script(void) { aFree(script->hq[i].item); } } - if( script->hqis ) { + if (script->hqis && script->hqi) { for( i = 0; i < script->hqis; i++ ) { if( script->hqi[i].item != NULL ) aFree(script->hqi[i].item); @@ -9439,18 +9441,6 @@ BUILDIN(donpcevent) return true; } -/// for Aegis compatibility -/// basically a specialized 'donpcevent', with the event specified as two arguments instead of one [RoVeRT] -BUILDIN(cmdothernpc) { - const char* npc_name = script_getstr(st,2); - const char* command = script_getstr(st,3); - char event[EVENT_NAME_LENGTH]; - snprintf(event, sizeof(event), "%s::OnCommand%s", npc_name, command); - script->check_event(st, event); - npc->event_do(event); - return true; -} - /*========================================== *------------------------------------------*/ BUILDIN(addtimer) @@ -19269,7 +19259,6 @@ void script_parse_builtin(void) { BUILDIN_DEF(setmount,"?"), BUILDIN_DEF(checkmount,""), BUILDIN_DEF(checkwug,""), - BUILDIN_DEF2_DEPRECATED(savepoint,"save","sii"), // Deprecated 2014-11-02 [Haru] BUILDIN_DEF(savepoint,"sii"), BUILDIN_DEF(gettimetick,"i"), BUILDIN_DEF(gettime,"i"), @@ -19287,7 +19276,6 @@ void script_parse_builtin(void) { BUILDIN_DEF(clone,"siisi????"), BUILDIN_DEF(doevent,"s"), BUILDIN_DEF(donpcevent,"s"), - BUILDIN_DEF_DEPRECATED(cmdothernpc,"ss"), // Deprecated 2014-11-02 [Haru] BUILDIN_DEF(addtimer,"is"), BUILDIN_DEF(deltimer,"s"), BUILDIN_DEF(addtimercount,"si"), @@ -19332,8 +19320,6 @@ void script_parse_builtin(void) { BUILDIN_DEF2(waitingroomkickall,"kickwaitingroomall","?"), BUILDIN_DEF(enablewaitingroomevent,"?"), BUILDIN_DEF(disablewaitingroomevent,"?"), - BUILDIN_DEF2_DEPRECATED(enablewaitingroomevent,"enablearena",""), // Deprecated 2014-11-02 [Haru] - BUILDIN_DEF2_DEPRECATED(disablewaitingroomevent,"disablearena",""), // Deprecated 2014-11-02 [Haru] BUILDIN_DEF(getwaitingroomstate,"i?"), BUILDIN_DEF(warpwaitingpc,"sii?"), BUILDIN_DEF(attachrid,"i"), |