From 99a145cd125acee65d453fc19ca49f9fd28815ae Mon Sep 17 00:00:00 2001 From: bmgjet <50484759+bmgjet@users.noreply.github.com> Date: Sun, 1 Aug 2021 17:35:29 +1200 Subject: [PATCH] Version 1.0.4 --- BCargo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BCargo.cs b/BCargo.cs index 698e6f0..c657354 100644 --- a/BCargo.cs +++ b/BCargo.cs @@ -290,7 +290,9 @@ namespace Oxide.Plugins public void CargoPoints(BasePlayer player, Vector3 location) { - int node = CargoBlockPoint.Keys.Last() + 1; + int node = 0; + try { node = CargoBlockPoint.Keys.Last() + 1; } + catch { } CargoBlockPoint.Add(node, location); message(player, "added", node); } @@ -298,6 +300,10 @@ namespace Oxide.Plugins public bool BlockE(Vector3 currentlocation) { //checks each point to see if cargo is within area. + if (CargoBlockPoint == null) + { + return false; + } foreach (KeyValuePair blockpoints in CargoBlockPoint) { if (Vector3.Distance(currentlocation, blockpoints.Value) < config.LeaveBlockDistance)