use BoostAI for enterPayloadCommand & better onlyDepositCore handling (#11297)
This commit is contained in:
@@ -452,7 +452,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
@Remote(targets = Loc.both, forward = true, called = Loc.server)
|
||||
public static void transferInventory(Player player, Building build){
|
||||
if(player == null || build == null || !player.within(build, itemTransferRange) || build.items == null || player.dead() || (state.rules.onlyDepositCore && !(build instanceof CoreBuild))) return;
|
||||
if(player == null || build == null || !player.within(build, itemTransferRange) || build.items == null || player.dead() || !build.allowDeposit()) return;
|
||||
|
||||
if(net.server() && (player.unit().stack.amount <= 0 || !Units.canInteract(player, build) ||
|
||||
//to avoid rejecting deposit packets that happen to overlap due to packet speed differences, the actual cap is double the cooldown with 2 deposits.
|
||||
@@ -2089,7 +2089,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
if(build != null && build.acceptStack(stack.item, stack.amount, player.unit()) > 0 && build.interactable(player.team()) &&
|
||||
build.block.hasItems && player.unit().stack().amount > 0 && build.interactable(player.team())){
|
||||
|
||||
if(!(state.rules.onlyDepositCore && !(build instanceof CoreBuild)) && itemDepositCooldown <= 0f){
|
||||
if(build.allowDeposit() && itemDepositCooldown <= 0f){
|
||||
Call.transferInventory(player, build);
|
||||
itemDepositCooldown = state.rules.itemDepositCooldown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user