Is there a way to block a drone from going to set vending machines?
Can you block drones from VendingMachine?
Comparing the player location to the vending machine location might work in the CanUseVending hook. Or maybe OnVendingTransaction.
ya does not call when using drone Humm.
I'm also looking to block drone to specific Vending Machine. UP!
I have found a public method. Perhaps a hook could be added there:
public bool IsVendingMachineAccessible(VendingMachine vendingMachine, Vector3 offset, out RaycastHit hitInfo)
{
Vector3 vector3 = vendingMachine.transform.TransformPoint(offset);
if (Physics.BoxCast(vector3 + (Vector3.up * this.testHeight), this.halfExtents, Vector3.down, out hitInfo, vendingMachine.transform.rotation, this.testHeight, this.layerMask)) {
return false;
}
return vendingMachine.IsVisibleAndCanSee(vector3, 2f);
}Merged post
I tried to patch this method and it works! The hook is called when a player open the marketplace so, if you revoke a Vending Machine, it will show "Unreachable" on the map!
public bool IsVendingMachineAccessible(VendingMachine vendingMachine, Vector3 offset, out RaycastHit hitInfo)
{
object returnvar = Interface.CallHook("IsVendingMachineAccessible", vendingMachine, offset);
if (returnvar is bool)
{
return (bool)returnvar;
}
Vector3 vector = vendingMachine.transform.TransformPoint(offset);
return !Physics.BoxCast(vector + Vector3.up * this.testHeight, this.halfExtents, Vector3.down, out hitInfo, vendingMachine.transform.rotation, this.testHeight, this.layerMask) && vendingMachine.IsVisibleAndCanSee(vector, 2f);
}