Block Container Transfer out of Buyback Container if the item hasn't actually been bought back

This commit is contained in:
AconiteX
2021-06-03 23:22:52 -04:00
parent dccc8a9b55
commit 6aa96f006a
4 changed files with 40 additions and 1 deletions
@@ -119,6 +119,9 @@ public class autostack extends script.base_script
}
public void restackIt(obj_id self) throws InterruptedException
{
if(isPendingJunkDeal(self)) {
return;
}
blog("restackIt init");
if (!isIdValid(self) || !exists(self))
{
@@ -149,7 +152,7 @@ public class autostack extends script.base_script
obj_id item = loot.findItemToStack(self);
if (isIdValid(item) && !isInSecureTrade(item))
{
if (utils.hasScriptVar(self, "unstacking") || utils.hasScriptVar(item, "unstacking"))
if (utils.hasScriptVar(self, "unstacking") || utils.hasScriptVar(item, "unstacking") || isPendingJunkDeal(item))
{
return;
}
@@ -165,6 +168,9 @@ public class autostack extends script.base_script
}
public void unstackIt(obj_id self, obj_id player) throws InterruptedException
{
if(isPendingJunkDeal(self)) {
return;
}
if (!isInSecureTrade(self))
{
if (getCount(self) == 2)
@@ -296,4 +302,9 @@ public class autostack extends script.base_script
LOG(BLOGGING_CATEGORY, msg);
return true;
}
// Used to block stack/split if item should be in Junk Dealer Buy Back Container
public boolean isPendingJunkDeal(obj_id item) {
return hasObjVar(item, smuggler.BUYBACK_OBJ_SOLD);
}
}