summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/magic/mpregen.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/npc/magic/mpregen.txt b/npc/magic/mpregen.txt
index 7bbd4e471..95d035028 100644
--- a/npc/magic/mpregen.txt
+++ b/npc/magic/mpregen.txt
@@ -25,11 +25,17 @@ function script SK_transfermp {
.@mp = Sp;
.@me = getcharid(3);
.@tg = getarg(0, @skillTarget);
+ if (getunittype(.@tg) != BL_PC) {
+ dispbottom l("This skill can only be used on other players.");
+ return;
+ }
+ // Switch the player
detachrid();
attachrid(.@tg);
+ // Safeguard (redundant, hopefully)
if (!playerattached()) {
attachrid(.@me);
- dispbottom l("Specified target does not exist. An error happened.");
+ consolewarn("Specified target %d for SK_transfermp does not exist. An error happened.", .@tg);
return;
}
.@mo = MaxSp - Sp;