public void askSalvageBarricade(CSteamID steamID, byte x, byte y, ushort plant, ushort index) { BarricadeRegion barricadeRegion; bool cancel = false; if (BarricadeManager.tryGetRegion(x, y, plant, out barricadeRegion)) { BarricadeData data = barricadeRegion.barricades[(int)index]; BarricadeEvents.RunBarricadeSalvage(UnturnedBarricade.Create(data), ref cancel); } if (!cancel) { DetourManager.CallOriginal(typeof(BarricadeManager).GetMethod("askSalvageBarricade", BindingFlags.Public | BindingFlags.Instance), BarricadeManager.instance, steamID, x, y, plant, index); } }
internal static void RunBarricadeCreated(BarricadeData barricade, ref bool cancel) => OnBarricadeCreated?.Invoke(UnturnedBarricade.Create(barricade), ref cancel);