From fdca83e17abff71c69b44c52ecaa4b770786855d Mon Sep 17 00:00:00 2001 From: expwnent Date: Tue, 15 Sep 2015 02:32:58 -0400 Subject: [PATCH] Tweak modtools/create-item (creator = \LAST) --- scripts/modtools/create-item.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/modtools/create-item.lua b/scripts/modtools/create-item.lua index ff5740dbb..b7c88bb45 100644 --- a/scripts/modtools/create-item.lua +++ b/scripts/modtools/create-item.lua @@ -104,10 +104,11 @@ arguments: -help print this help message -creator id - specify the id of the unit who will create the item + specify the id of the unit who will create the item, or \\LAST to indicate the unit with id df.global.unit_next_id-1 examples: 0 2 + \\LAST -material matstring specify the material of the item to be created examples: @@ -126,4 +127,8 @@ arguments: return end +if args.creator == '\\LAST' then + args.creator = tostring(df.global.unit_next_id-1) +end + createItem(tonumber(args.creator), args.item, args.material, args.leftHand, args.rightHand, args.quality)