private void OnSalvageStructureRequested(CSteamID steamID, byte x, byte y, ushort index, ref bool shouldAllow) { StructureData data = StructureManager.regions[x, y].structures[index]; StructureDrop drop = StructureManager.regions[x, y].drops[index]; UnturnedStructureSalvagingEvent @event = new UnturnedStructureSalvagingEvent(new UnturnedStructureBuildable(data, drop)); Emit(@event); shouldAllow = [email protected]; }
private void OnSalvageStructureRequested(CSteamID steamId, byte x, byte y, ushort index, ref bool shouldAllow) { if (!StructureManager.tryGetRegion(x, y, out var region)) { return; } var data = region.structures[index]; var drop = region.drops[index]; var @event = new UnturnedStructureSalvagingEvent(new UnturnedStructureBuildable(data, drop)); Emit(@event); shouldAllow = [email protected]; }