Skip to content

Commit

Permalink
Make type 0 entities inactive in SetDefaults and TurnToAir (tModLoade…
Browse files Browse the repository at this point in the history
  • Loading branch information
Chicken-Bones authored Jan 19, 2024
1 parent 16cac83 commit 5fa7918
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
12 changes: 11 additions & 1 deletion patches/tModLoader/Terraria/Item.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,15 @@
placeStyle = 0;
buffTime = 0;
buffType = 0;
@@ -47366,7 +_,7 @@
noUseGraphic = false;
lifeRegen = 0;
shootSpeed = 0f;
- active = true;
+ active = Type != 0;
alpha = 0;
ammo = AmmoID.None;
useAmmo = AmmoID.None;
@@ -47426,6 +_,9 @@

public Color GetAlpha(Color newColor)
Expand Down Expand Up @@ -2240,10 +2249,11 @@
public void ClearNameOverride()
{
_nameOverride = null;
@@ -49309,6 +_,9 @@
@@ -49309,6 +_,10 @@
dye = 0;
shoot = 0;
mountType = -1;
+ active = false;
+
+ ModItem = null;
+ _globals = null;
Expand Down
9 changes: 9 additions & 0 deletions patches/tModLoader/Terraria/NPC.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,15 @@
setFrameSize = false;
netSkip = -2;
realLife = -1;
@@ -2254,7 +_,7 @@
boss = false;
noTileCollide = false;
rotation = 0f;
- active = true;
+ active = Type != 0;
alpha = 0;
color = default(Color);
collideX = false;
@@ -6970,7 +_,9 @@
DeathSound = SoundID.NPCDeath1;
npcSlots = 0.1f;
Expand Down
9 changes: 9 additions & 0 deletions patches/tModLoader/Terraria/Projectile.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@
ownerHitCheck = false;
hide = false;
lavaWet = false;
@@ -312,7 +_,7 @@
alpha = 0;
glowMask = -1;
type = Type;
- active = true;
+ active = Type != 0;
rotation = 0f;
scale = 1f;
owner = 255;
@@ -1167,6 +_,8 @@
magic = true;
}
Expand Down

0 comments on commit 5fa7918

Please sign in to comment.