summaryrefslogtreecommitdiff
path: root/src/actions/actions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r--src/actions/actions.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index a666d01a2..0b8e8aedc 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -480,7 +480,8 @@ impHandler(heal)
const Being *being = nullptr;
if (args[0] == ':')
{
- being = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ being = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
if (being && being->getType() == ActorType::Monster)
being = nullptr;
}
@@ -588,7 +589,8 @@ impHandler(pickup)
}
else
{
- FloorItem *const item = actorManager->findItem(atoi(args.c_str()));
+ FloorItem *const item = actorManager->findItem(fromInt(
+ atoi(args.c_str()), BeingId));
if (item)
localPlayer->pickUp(item);
}
@@ -758,7 +760,8 @@ impHandler(attack)
}
else
{
- target = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
if (target && target->getType() != ActorType::Monster)
target = nullptr;
}
@@ -789,7 +792,8 @@ impHandler(targetAttack)
}
else
{
- target = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
if (target && target->getType() != ActorType::Monster)
target = nullptr;
}
@@ -1599,9 +1603,14 @@ impHandler(kick)
if (!args.empty())
{
if (args[0] != ':')
+ {
target = actorManager->findNearestByName(args);
+ }
else
- target = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ {
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
+ }
}
if (!target)
target = localPlayer->getTarget();