More item request validation
This commit is contained in:
@@ -405,7 +405,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
|
|
||||||
@Remote(called = Loc.server, targets = Loc.both, forward = true)
|
@Remote(called = Loc.server, targets = Loc.both, forward = true)
|
||||||
public static void requestItem(Player player, Building build, Item item, int amount){
|
public static void requestItem(Player player, Building build, Item item, int amount){
|
||||||
if(player == null || build == null || !build.interactable(player.team()) || !player.within(build, itemTransferRange) || player.dead()) return;
|
if(player == null || build == null || !build.interactable(player.team()) || !player.within(build, itemTransferRange) || player.dead() || amount <= 0) return;
|
||||||
|
|
||||||
if(net.server() && (!Units.canInteract(player, build) ||
|
if(net.server() && (!Units.canInteract(player, build) ||
|
||||||
!netServer.admins.allowAction(player, ActionType.withdrawItem, build.tile(), action -> {
|
!netServer.admins.allowAction(player, ActionType.withdrawItem, build.tile(), action -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user