diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:59:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:59:31 +0300 |
commit | 00083cc82fdd40870f517d6954fe3b28cea72f65 (patch) | |
tree | d7abdbe970d784498a9ce87416d145074ab34332 /src/progs/manaplus/actions/actions.cpp | |
parent | 437586e9dad478fd63a96d442ab77b744ce6fec3 (diff) | |
download | plus-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.gz plus-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.bz2 plus-00083cc82fdd40870f517d6954fe3b28cea72f65.tar.xz plus-00083cc82fdd40870f517d6954fe3b28cea72f65.zip |
Send talk request from context menu by being id.
Diffstat (limited to 'src/progs/manaplus/actions/actions.cpp')
-rw-r--r-- | src/progs/manaplus/actions/actions.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 5b5a00a05..9c0188d20 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -825,7 +825,19 @@ impHandler(sell) impHandler(talk) { - Being *being = findBeing(event.args, true); + const std::string args = event.args; + Being *being = nullptr; + + if (!args.empty() && args[0] == ':') + { + being = actorManager->findBeing(fromInt(atoi( + args.substr(1).c_str()), BeingId)); + } + else + { + being = findBeing(args, true); + } + if (being == nullptr) return false; |