-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Container Transfer out of Buyback Container if the item hasn't …
…actually been bought back
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package script.object; | ||
|
||
import script.library.smuggler; | ||
import script.obj_id; | ||
|
||
public class buyback extends script.base_script { | ||
|
||
/** | ||
* Triggered when this item is about to be transferred from the buyback container | ||
* potentially into another container (like player inventory), in which case we will | ||
* first validate that the item has actually been bought back. | ||
*/ | ||
public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException { | ||
|
||
if(hasObjVar(self, smuggler.BUYBACK_OBJ_SOLD)) { | ||
if(getTemplateName(destContainer).equalsIgnoreCase(smuggler.BUY_BACK_CONTROL_DEVICE_TEMPLATE)) { | ||
return SCRIPT_CONTINUE; | ||
} else { | ||
return SCRIPT_OVERRIDE; | ||
} | ||
} | ||
return SCRIPT_CONTINUE; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters