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()
|
||||
{
|
||||
if (Cooking) return;
|
||||
if (Open) return;
|
||||
|
||||
Appearance?.SetData(CrematoriumVisuals.Burning, true);
|
||||
Cooking = true;
|
||||
@@ -64,15 +65,18 @@ namespace Content.Server.GameObjects.Components.Morgue
|
||||
Appearance?.SetData(CrematoriumVisuals.Burning, false);
|
||||
Cooking = false;
|
||||
|
||||
for (var i = Contents.ContainedEntities.Count - 1; i >= 0; i--)
|
||||
if (Contents.ContainedEntities.Count > 0)
|
||||
{
|
||||
var item = Contents.ContainedEntities[i];
|
||||
Contents.Remove(item);
|
||||
item.Delete();
|
||||
}
|
||||
for (var i = Contents.ContainedEntities.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var item = Contents.ContainedEntities[i];
|
||||
Contents.Remove(item);
|
||||
item.Delete();
|
||||
}
|
||||
|
||||
var ash = Owner.EntityManager.SpawnEntity("Ash", Owner.Transform.Coordinates);
|
||||
Contents.Insert(ash);
|
||||
var ash = Owner.EntityManager.SpawnEntity("Ash", Owner.Transform.Coordinates);
|
||||
Contents.Insert(ash);
|
||||
}
|
||||
|
||||
TryOpenStorage(Owner);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user