Fixed crematorium creating ash out of nothing and being allowed to cremate while open (#2473)
This commit is contained in:
@@ -55,6 +55,7 @@ namespace Content.Server.GameObjects.Components.Morgue
|
|||||||
public void Cremate()
|
public void Cremate()
|
||||||
{
|
{
|
||||||
if (Cooking) return;
|
if (Cooking) return;
|
||||||
|
if (Open) return;
|
||||||
|
|
||||||
Appearance?.SetData(CrematoriumVisuals.Burning, true);
|
Appearance?.SetData(CrematoriumVisuals.Burning, true);
|
||||||
Cooking = true;
|
Cooking = true;
|
||||||
@@ -64,15 +65,18 @@ namespace Content.Server.GameObjects.Components.Morgue
|
|||||||
Appearance?.SetData(CrematoriumVisuals.Burning, false);
|
Appearance?.SetData(CrematoriumVisuals.Burning, false);
|
||||||
Cooking = false;
|
Cooking = false;
|
||||||
|
|
||||||
for (var i = Contents.ContainedEntities.Count - 1; i >= 0; i--)
|
if (Contents.ContainedEntities.Count > 0)
|
||||||
{
|
{
|
||||||
var item = Contents.ContainedEntities[i];
|
for (var i = Contents.ContainedEntities.Count - 1; i >= 0; i--)
|
||||||
Contents.Remove(item);
|
{
|
||||||
item.Delete();
|
var item = Contents.ContainedEntities[i];
|
||||||
}
|
Contents.Remove(item);
|
||||||
|
item.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
var ash = Owner.EntityManager.SpawnEntity("Ash", Owner.Transform.Coordinates);
|
var ash = Owner.EntityManager.SpawnEntity("Ash", Owner.Transform.Coordinates);
|
||||||
Contents.Insert(ash);
|
Contents.Insert(ash);
|
||||||
|
}
|
||||||
|
|
||||||
TryOpenStorage(Owner);
|
TryOpenStorage(Owner);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user