NPCs Taxis and Crafters now checks properly
Fixed taxis that wouldn't check for mesos upon travel. Fixed crafters that wouldn't check for inventory slots available before crafting items.
This commit is contained in:
@@ -205,8 +205,14 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -226,20 +232,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1)
|
||||
if (!cm.haveItem(mats[i]))
|
||||
complete = false;
|
||||
else
|
||||
if (!cm.haveItem(mats[i],matQty[i])) complete=false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
@@ -254,10 +246,8 @@ function action(mode, type, selection) {
|
||||
cm.gainItem(mats, -matQty * qty);
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
Reference in New Issue
Block a user