public static bool CanLoot(this HarvestableObjectView instance, LocalPlayerCharacterView player) { if (instance.IsLootProtected()) { return(false); } var requiresTool = instance.RequiresTool(); var tool = instance.GetTool(player); if (requiresTool && tool == null) { return(false); } var toolProxy = a4x.a(tool) as a39; var durability = toolProxy != null?a4x.b(tool.b3(), toolProxy.ba()) : -1; if (requiresTool && durability <= 10) { return(false); } return(true); }
public static bool CanLoot(this HarvestableObjectView instance, LocalPlayerCharacterView player) { if (instance.IsLootProtected()) { return(false); } var tool = instance.GetTool(player); if (tool == null && instance.RequiresTool()) { return(false); } return(true); }