diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-06-13 14:43:17 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-04-15 11:44:58 -0400 |
commit | 87312fe719956671a77a3c78021e821c679764fe (patch) | |
tree | fc98172c03169a8b127f1c083a706b9d7bafeecf /src/map | |
parent | 2ca62094a347c9fe69383709728fe1a64650e401 (diff) | |
download | tmwa-87312fe719956671a77a3c78021e821c679764fe.tar.gz tmwa-87312fe719956671a77a3c78021e821c679764fe.tar.bz2 tmwa-87312fe719956671a77a3c78021e821c679764fe.tar.xz tmwa-87312fe719956671a77a3c78021e821c679764fe.zip |
shrink magic_message
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/npc.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp index eaf54ec..5509b6b 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -206,12 +206,12 @@ int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation) RString spell_params = pair.second; - dumb_ptr<npc_data> nd = npc_name2id(spell_name); + dumb_ptr<npc_data> nd = npc_name2id(spell_event.label? spell_event.npc: spell_name); if (nd) { - PRINTF("NPC: %s %d\n"_fmt, nd->name, nd->bl_id); - PRINTF("Params: %s\n"_fmt, spell_params); + PRINTF("NPC: '%s' %d\n"_fmt, nd->name, nd->bl_id); + PRINTF("Params: '%s'\n"_fmt, spell_params); caster->npc_id = nd->bl_id; dumb_ptr<block_list> map_bl = map_id2bl(nd->bl_id); if (!map_bl) @@ -220,23 +220,11 @@ int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation) { {"@args$"_s, spell_params}, }; - caster->npc_pos = run_script_l(ScriptPointer(borrow(*nd->is_script()->scr.script), 0), caster->bl_id, nd->bl_id, arg); - return 1; - } - if (spell_event.label) - { - dumb_ptr<npc_data> nd = npc_name2id(spell_event.npc); - PRINTF("NPC: %s %d\n"_fmt, nd->name, nd->bl_id); - PRINTF("Params: %s\n"_fmt, spell_params); - caster->npc_id = nd->bl_id; - dumb_ptr<block_list> map_bl = map_id2bl(nd->bl_id); - if (!map_bl) - map_addnpc(caster->bl_m, nd); - argrec_t arg[1] = - { - {"@args$"_s, spell_params}, - }; - caster->npc_pos = npc_event_do_l(spell_event, caster->bl_id, arg); + + if (spell_event.label) + caster->npc_pos = npc_event_do_l(spell_event, caster->bl_id, arg); + else + caster->npc_pos = run_script_l(ScriptPointer(borrow(*nd->is_script()->scr.script), 0), caster->bl_id, nd->bl_id, arg); return 1; } return 0; |