From 497231ee09c6c813eb90e87c4f2ee48649f49b9d Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Sun, 20 Oct 2024 01:27:54 -0400 Subject: [PATCH] GeneratorSystem: no eject on empty (#2291) --- Content.Server/Power/Generator/GeneratorSystem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Content.Server/Power/Generator/GeneratorSystem.cs b/Content.Server/Power/Generator/GeneratorSystem.cs index e2c551c103c..cbe454f69a9 100644 --- a/Content.Server/Power/Generator/GeneratorSystem.cs +++ b/Content.Server/Power/Generator/GeneratorSystem.cs @@ -74,6 +74,8 @@ private void SolidEmpty(EntityUid uid, SolidFuelGeneratorAdapterComponent compon else { int materialAmount = _materialStorage.GetMaterialAmount(uid, component.FuelMaterial); + if (materialAmount <= 0) // No fuel? Job done. + return; _materialStorage.TryChangeMaterialAmount(uid, component.FuelMaterial, -materialAmount); var ejectedUid = Spawn(component.EjectedFuelProtoId, Transform(uid).Coordinates);