private void OnRevolverInit(EntityUid uid, RevolverAmmoProviderComponent component, ComponentInit args) { component.AmmoContainer = Containers.EnsureContainer <Container>(uid, RevolverContainer); component.AmmoSlots.EnsureCapacity(component.Capacity); var remainder = component.Capacity - component.AmmoSlots.Count; for (var i = 0; i < remainder; i++) { component.AmmoSlots.Add(null); } component.Chambers = new bool?[component.Capacity]; if (component.FillPrototype != null) { for (var i = 0; i < component.Capacity; i++) { if (component.AmmoSlots[i] != null) { component.Chambers[i] = null; continue; } component.Chambers[i] = true; } } DebugTools.Assert(component.AmmoSlots.Count == component.Capacity); }