From 641ce118cd48d0c07abb20d79eba27e1233d84d5 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Fri, 16 Feb 2024 22:55:23 -0800 Subject: [PATCH] fixed leaves and droplets not being child friendly --- Gores/AstralWaterDroplet.cs | 6 ++++++ Gores/Trees/AstralLeaf.cs | 13 +++++++++---- Gores/Trees/SulphurLeaf.cs | 13 +++++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Gores/AstralWaterDroplet.cs b/Gores/AstralWaterDroplet.cs index 9eb6588b4d..31964f3627 100644 --- a/Gores/AstralWaterDroplet.cs +++ b/Gores/AstralWaterDroplet.cs @@ -6,11 +6,17 @@ using Terraria.ModLoader; using Terraria.ID; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; namespace CalamityMod.Gores { public class AstralWaterDroplet : ModGore { + public override void SetStaticDefaults() + { + ChildSafety.SafeGore[Type] = true; + } + public override void OnSpawn(Gore gore, IEntitySource source) { gore.numFrames = 15; diff --git a/Gores/Trees/AstralLeaf.cs b/Gores/Trees/AstralLeaf.cs index 546ba9c563..e177f66a70 100644 --- a/Gores/Trees/AstralLeaf.cs +++ b/Gores/Trees/AstralLeaf.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using Terraria.GameContent; using Terraria.DataStructures; @@ -7,8 +7,13 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Gores.Trees { public class AstralLeaf : ModGore - { - public override void OnSpawn(Gore gore, IEntitySource source) + { + public override void SetStaticDefaults() + { + ChildSafety.SafeGore[Type] = true; + } + + public override void OnSpawn(Gore gore, IEntitySource source) { ChildSafety.SafeGore[gore.type] = true; gore.velocity = new Vector2(Main.rand.NextFloat() - 0.5f, Main.rand.NextFloat() * MathHelper.TwoPi); @@ -18,4 +23,4 @@ namespace CalamityMod.Gores.Trees UpdateType = 910; } } -} \ No newline at end of file +} diff --git a/Gores/Trees/SulphurLeaf.cs b/Gores/Trees/SulphurLeaf.cs index 2d081a4f47..6686b0f28a 100644 --- a/Gores/Trees/SulphurLeaf.cs +++ b/Gores/Trees/SulphurLeaf.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using Terraria.GameContent; using Terraria.DataStructures; @@ -7,8 +7,13 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Gores.Trees { public class SulphurLeaf : ModGore - { - public override void OnSpawn(Gore gore, IEntitySource source) + { + public override void SetStaticDefaults() + { + ChildSafety.SafeGore[Type] = true; + } + + public override void OnSpawn(Gore gore, IEntitySource source) { ChildSafety.SafeGore[gore.type] = true; gore.velocity = new Vector2(Main.rand.NextFloat() - 0.5f, Main.rand.NextFloat() * MathHelper.TwoPi); @@ -18,4 +23,4 @@ namespace CalamityMod.Gores.Trees UpdateType = 910; } } -} \ No newline at end of file +}