diff --git a/Content/Bosses/GlassMiniboss/NPCs.Glassweaver.cs b/Content/Bosses/GlassMiniboss/NPCs.Glassweaver.cs index ebd569533..f296197b8 100644 --- a/Content/Bosses/GlassMiniboss/NPCs.Glassweaver.cs +++ b/Content/Bosses/GlassMiniboss/NPCs.Glassweaver.cs @@ -341,14 +341,14 @@ public override void AI() public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(moveTarget); + writer.WriteVector2(moveTarget); writer.Write(attackVariant); writer.Write(NPC.direction); } public override void ReceiveExtraAI(BinaryReader reader) { - moveTarget = reader.ReadPackedVector2(); + moveTarget = reader.ReadVector2(); attackVariant = reader.ReadBoolean(); NPC.direction = reader.ReadInt32(); } diff --git a/Content/Bosses/VitricBoss/NPCs.VitricBoss.cs b/Content/Bosses/VitricBoss/NPCs.VitricBoss.cs index 9df18ea5d..4a9afd184 100644 --- a/Content/Bosses/VitricBoss/NPCs.VitricBoss.cs +++ b/Content/Bosses/VitricBoss/NPCs.VitricBoss.cs @@ -828,9 +828,9 @@ public override void SendExtraAI(System.IO.BinaryWriter writer) writer.Write(altAttack); writer.Write(lockedRotation); - writer.WritePackedVector2(startPos); - writer.WritePackedVector2(endPos); - writer.WritePackedVector2(homePos); + writer.WriteVector2(startPos); + writer.WriteVector2(endPos); + writer.WriteVector2(homePos); writer.Write(NPC.dontTakeDamage); writer.Write(NPC.defense); @@ -846,9 +846,9 @@ public override void ReceiveExtraAI(System.IO.BinaryReader reader) altAttack = reader.ReadBoolean(); lockedRotation = reader.ReadSingle(); - startPos = reader.ReadPackedVector2(); - endPos = reader.ReadPackedVector2(); - homePos = reader.ReadPackedVector2(); + startPos = reader.ReadVector2(); + endPos = reader.ReadVector2(); + homePos = reader.ReadVector2(); NPC.dontTakeDamage = reader.ReadBoolean(); NPC.defense = reader.ReadInt32(); diff --git a/Content/Bosses/VitricBoss/NPCs.VitricBossCrystal.cs b/Content/Bosses/VitricBoss/NPCs.VitricBossCrystal.cs index 932bc107a..1e294442d 100644 --- a/Content/Bosses/VitricBoss/NPCs.VitricBossCrystal.cs +++ b/Content/Bosses/VitricBoss/NPCs.VitricBossCrystal.cs @@ -116,14 +116,14 @@ public bool findParent() public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(StartPos); - writer.WritePackedVector2(TargetPos); + writer.WriteVector2(StartPos); + writer.WriteVector2(TargetPos); } public override void ReceiveExtraAI(BinaryReader reader) { - StartPos = reader.ReadPackedVector2(); - TargetPos = reader.ReadPackedVector2(); + StartPos = reader.ReadVector2(); + TargetPos = reader.ReadVector2(); } public override void AI() diff --git a/Content/Bosses/VitricBoss/Projectiles.LavaDart.cs b/Content/Bosses/VitricBoss/Projectiles.LavaDart.cs index 1fed0252e..12aaba215 100644 --- a/Content/Bosses/VitricBoss/Projectiles.LavaDart.cs +++ b/Content/Bosses/VitricBoss/Projectiles.LavaDart.cs @@ -139,14 +139,14 @@ public override void PostDraw(Color lightColor) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(midPoint); - writer.WritePackedVector2(endPoint); + writer.WriteVector2(midPoint); + writer.WriteVector2(endPoint); } public override void ReceiveExtraAI(BinaryReader reader) { - midPoint = reader.ReadPackedVector2(); - endPoint = reader.ReadPackedVector2(); + midPoint = reader.ReadVector2(); + endPoint = reader.ReadVector2(); if (startPoint == Vector2.Zero) setStartAndDist(); diff --git a/Content/Items/Breacher/Weapons.FlareBreacher.cs b/Content/Items/Breacher/Weapons.FlareBreacher.cs index 67f6c8051..debd646ca 100644 --- a/Content/Items/Breacher/Weapons.FlareBreacher.cs +++ b/Content/Items/Breacher/Weapons.FlareBreacher.cs @@ -187,14 +187,14 @@ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) public override void SendExtraAI(BinaryWriter writer) { writer.Write(stuck); - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(enemyID); } public override void ReceiveExtraAI(BinaryReader reader) { stuck = reader.ReadBoolean(); - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); enemyID = reader.ReadInt32(); } diff --git a/Content/Items/Dungeon/Weapons.Cloudstrike.cs b/Content/Items/Dungeon/Weapons.Cloudstrike.cs index 3360b9048..1e984c265 100644 --- a/Content/Items/Dungeon/Weapons.Cloudstrike.cs +++ b/Content/Items/Dungeon/Weapons.Cloudstrike.cs @@ -674,7 +674,7 @@ private void UpdateRotation() public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(mousePos); + writer.WriteVector2(mousePos); writer.Write(oldRotation); writer.Write(followPlayer); writer.Write(Projectile.timeLeft); @@ -682,7 +682,7 @@ public override void SendExtraAI(BinaryWriter writer) public override void ReceiveExtraAI(BinaryReader reader) { - mousePos = reader.ReadPackedVector2(); + mousePos = reader.ReadVector2(); oldRotation = reader.ReadSingle(); followPlayer = reader.ReadBoolean(); Projectile.timeLeft = reader.ReadInt32(); diff --git a/Content/Items/Gravedigger/Weapons.GravediggerItem.cs b/Content/Items/Gravedigger/Weapons.GravediggerItem.cs index d97cd9342..6bdc922b2 100644 --- a/Content/Items/Gravedigger/Weapons.GravediggerItem.cs +++ b/Content/Items/Gravedigger/Weapons.GravediggerItem.cs @@ -403,8 +403,8 @@ private void CreateBlood(NPC target, int hitDirection, float knockback) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(directionTwo); - writer.WritePackedVector2(direction); + writer.WriteVector2(directionTwo); + writer.WriteVector2(direction); writer.Write(Projectile.frame); writer.Write(Projectile.frameCounter); writer.Write(SlashWindow); @@ -414,8 +414,8 @@ public override void SendExtraAI(BinaryWriter writer) public override void ReceiveExtraAI(BinaryReader reader) { - directionTwo = reader.ReadPackedVector2(); - direction = reader.ReadPackedVector2(); + directionTwo = reader.ReadVector2(); + direction = reader.ReadVector2(); Projectile.frame = reader.ReadInt32(); Projectile.frameCounter = reader.ReadInt32(); SlashWindow = reader.ReadInt32(); diff --git a/Content/Items/Haunted/Accessories.TaintedGreataxe.cs b/Content/Items/Haunted/Accessories.TaintedGreataxe.cs index d30410254..77b139272 100644 --- a/Content/Items/Haunted/Accessories.TaintedGreataxe.cs +++ b/Content/Items/Haunted/Accessories.TaintedGreataxe.cs @@ -353,14 +353,14 @@ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) public override void SendExtraAI(BinaryWriter writer) { writer.Write(stickyAI); - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(enemyWhoAmI); } public override void ReceiveExtraAI(BinaryReader reader) { stickyAI = reader.ReadBoolean(); - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); enemyWhoAmI = reader.ReadInt32(); } diff --git a/Content/Items/Haunted/Weapons.HauntedDaggerStaff.cs b/Content/Items/Haunted/Weapons.HauntedDaggerStaff.cs index 11705659a..2a333e7df 100644 --- a/Content/Items/Haunted/Weapons.HauntedDaggerStaff.cs +++ b/Content/Items/Haunted/Weapons.HauntedDaggerStaff.cs @@ -541,7 +541,7 @@ internal NPC FindTarget() public override void SendExtraAI(BinaryWriter writer) { writer.Write(embedded); - writer.WritePackedVector2(enemyOffset); + writer.WriteVector2(enemyOffset); if (embeddedTarget != null) writer.Write(embeddedTarget.whoAmI); @@ -552,7 +552,7 @@ public override void SendExtraAI(BinaryWriter writer) public override void ReceiveExtraAI(BinaryReader reader) { embedded = reader.ReadBoolean(); - enemyOffset = reader.ReadPackedVector2(); + enemyOffset = reader.ReadVector2(); int embeddedTargetId = reader.ReadInt32(); if (embeddedTargetId >= 0) diff --git a/Content/Items/Misc/SoilgunFiles/Weapons.SoilgunMiscProjectiles.cs b/Content/Items/Misc/SoilgunFiles/Weapons.SoilgunMiscProjectiles.cs index e955b8bc6..493ec3dc3 100644 --- a/Content/Items/Misc/SoilgunFiles/Weapons.SoilgunMiscProjectiles.cs +++ b/Content/Items/Misc/SoilgunFiles/Weapons.SoilgunMiscProjectiles.cs @@ -692,13 +692,13 @@ public override bool PreDraw(ref Color lightColor) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(enemyID); } public override void ReceiveExtraAI(BinaryReader reader) { - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); enemyID = reader.ReadInt32(); } } diff --git a/Content/Items/Vitric/Ammo.VitricBullet.cs b/Content/Items/Vitric/Ammo.VitricBullet.cs index 0b0679fc7..9f4d8b310 100644 --- a/Content/Items/Vitric/Ammo.VitricBullet.cs +++ b/Content/Items/Vitric/Ammo.VitricBullet.cs @@ -270,13 +270,13 @@ public override void Kill(int timeLeft) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(enemyID); } public override void ReceiveExtraAI(BinaryReader reader) { - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); enemyID = reader.ReadInt32(); } } diff --git a/Content/Items/Vitric/Weapons.Coalescence.cs b/Content/Items/Vitric/Weapons.Coalescence.cs index 06dd9fc94..b48aa2db0 100644 --- a/Content/Items/Vitric/Weapons.Coalescence.cs +++ b/Content/Items/Vitric/Weapons.Coalescence.cs @@ -468,12 +468,12 @@ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(targetPoint); + writer.WriteVector2(targetPoint); } public override void ReceiveExtraAI(BinaryReader reader) { - targetPoint = reader.ReadPackedVector2(); + targetPoint = reader.ReadVector2(); } public void DrawAdditive(SpriteBatch spriteBatch) diff --git a/Content/Items/Vitric/Weapons.MagmiteVacpack.cs b/Content/Items/Vitric/Weapons.MagmiteVacpack.cs index b38ba3169..993b44f8d 100644 --- a/Content/Items/Vitric/Weapons.MagmiteVacpack.cs +++ b/Content/Items/Vitric/Weapons.MagmiteVacpack.cs @@ -410,14 +410,14 @@ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) public override void SendExtraAI(BinaryWriter writer) { writer.Write(stuck); - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(enemyID); } public override void ReceiveExtraAI(BinaryReader reader) { stuck = reader.ReadBoolean(); - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); enemyID = reader.ReadInt32(); } } diff --git a/Content/NPCs/Moonstone/AngryCrescent.cs b/Content/NPCs/Moonstone/AngryCrescent.cs index 1d11ef721..e67c2e706 100644 --- a/Content/NPCs/Moonstone/AngryCrescent.cs +++ b/Content/NPCs/Moonstone/AngryCrescent.cs @@ -386,7 +386,7 @@ public override void SendExtraAI(BinaryWriter writer) // Sort of sloppy making the assumption that only 1 packet is ever sent for state 1 and that its near enough to the transition if (AIState == 1) { - writer.WritePackedVector2(offset); + writer.WriteVector2(offset); writer.Write(pointOnChain); writer.Write(animating); writer.Write(initializeAnimation); @@ -405,7 +405,7 @@ public override void ReceiveExtraAI(BinaryReader reader) // Sort of sloppy making the assumption that only 1 packet is ever sent for state 1 and that its near enough to the transition if (AIState == 1) { - offset = reader.ReadPackedVector2(); + offset = reader.ReadVector2(); pointOnChain = reader.ReadInt32(); animating = reader.ReadBoolean(); initializeAnimation = reader.ReadBoolean(); diff --git a/Content/NPCs/Vitric/CrystalPopper.cs b/Content/NPCs/Vitric/CrystalPopper.cs index bf0b8f510..ddd45cdee 100644 --- a/Content/NPCs/Vitric/CrystalPopper.cs +++ b/Content/NPCs/Vitric/CrystalPopper.cs @@ -32,14 +32,14 @@ public override void SendExtraAI(BinaryWriter writer) { writer.Write(NPC.noGravity); writer.Write(NPC.target); - writer.WritePackedVector2(NPC.velocity); + writer.WriteVector2(NPC.velocity); } public override void ReceiveExtraAI(BinaryReader reader) { NPC.noGravity = reader.ReadBoolean(); NPC.target = reader.ReadInt32(); - NPC.velocity = reader.ReadPackedVector2(); + NPC.velocity = reader.ReadVector2(); } public override void SetDefaults() diff --git a/Content/NPCs/Vitric/Gauntlet/FlyingGruntConstruct.cs b/Content/NPCs/Vitric/Gauntlet/FlyingGruntConstruct.cs index 3cd02d369..05ba1f9f7 100644 --- a/Content/NPCs/Vitric/Gauntlet/FlyingGruntConstruct.cs +++ b/Content/NPCs/Vitric/Gauntlet/FlyingGruntConstruct.cs @@ -534,8 +534,8 @@ public override void SafeSendExtraAI(BinaryWriter writer) //frames are being used like cursed timers, maybe TODO: rework this writer.Write(xFrame); writer.Write(yFrame); - writer.WritePackedVector2(movementTarget); - writer.WritePackedVector2(oldPosition); + writer.WriteVector2(movementTarget); + writer.WriteVector2(oldPosition); brownianMotionRandSeed = Main.rand.Next(int.MaxValue); brownianRand = new(brownianMotionRandSeed); @@ -547,8 +547,8 @@ public override void SafeReceiveExtraAI(BinaryReader reader) { xFrame = reader.ReadInt32(); yFrame = reader.ReadInt32(); - movementTarget = reader.ReadPackedVector2(); - oldPosition = reader.ReadPackedVector2(); + movementTarget = reader.ReadVector2(); + oldPosition = reader.ReadVector2(); brownianMotionRandSeed = reader.ReadInt32(); brownianRand = new(brownianMotionRandSeed); diff --git a/Content/NPCs/Vitric/Gauntlet/FlyingPelterConstruct.cs b/Content/NPCs/Vitric/Gauntlet/FlyingPelterConstruct.cs index a38154739..c0c2f74c2 100644 --- a/Content/NPCs/Vitric/Gauntlet/FlyingPelterConstruct.cs +++ b/Content/NPCs/Vitric/Gauntlet/FlyingPelterConstruct.cs @@ -477,14 +477,14 @@ public override void DrawHealingGlow(SpriteBatch spriteBatch) public override void SafeSendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(posToBe); - writer.WritePackedVector2(oldPos); + writer.WriteVector2(posToBe); + writer.WriteVector2(oldPos); } public override void SafeReceiveExtraAI(BinaryReader reader) { - posToBe = reader.ReadPackedVector2(); - oldPos = reader.ReadPackedVector2(); + posToBe = reader.ReadVector2(); + oldPos = reader.ReadVector2(); } } diff --git a/Content/NPCs/Vitric/Gauntlet/GauntletSpawner.cs b/Content/NPCs/Vitric/Gauntlet/GauntletSpawner.cs index 86c559447..c49cc5470 100644 --- a/Content/NPCs/Vitric/Gauntlet/GauntletSpawner.cs +++ b/Content/NPCs/Vitric/Gauntlet/GauntletSpawner.cs @@ -51,16 +51,16 @@ public override void SpawnNPC() public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(startPos); //this may need to get changed into a safeSendExtraAI if the base class needs to send extra ai - writer.WritePackedVector2(targetPos); + writer.WriteVector2(startPos); //this may need to get changed into a safeSendExtraAI if the base class needs to send extra ai + writer.WriteVector2(targetPos); writer.Write(rand); //these could be put into ai[] fields but the base class should hold dominion over those writer.Write(moveTimer); } public override void ReceiveExtraAI(BinaryReader reader) { - startPos = reader.ReadPackedVector2(); - targetPos = reader.ReadPackedVector2(); + startPos = reader.ReadVector2(); + targetPos = reader.ReadVector2(); rand = reader.ReadSingle(); moveTimer = reader.ReadInt32(); } diff --git a/Content/NPCs/Vitric/MagmitePassive.cs b/Content/NPCs/Vitric/MagmitePassive.cs index 1299a75ab..b113a8999 100644 --- a/Content/NPCs/Vitric/MagmitePassive.cs +++ b/Content/NPCs/Vitric/MagmitePassive.cs @@ -71,12 +71,12 @@ public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestia public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(NPC.velocity); + writer.WriteVector2(NPC.velocity); } public override void ReceiveExtraAI(BinaryReader reader) { - NPC.velocity = reader.ReadPackedVector2(); + NPC.velocity = reader.ReadVector2(); } public override bool PreAI() diff --git a/Content/Tiles/Underground/EvasionShrineBullets/Dart.cs b/Content/Tiles/Underground/EvasionShrineBullets/Dart.cs index aef26bfd0..96d500079 100644 --- a/Content/Tiles/Underground/EvasionShrineBullets/Dart.cs +++ b/Content/Tiles/Underground/EvasionShrineBullets/Dart.cs @@ -193,15 +193,15 @@ public void DrawPrimitives() public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(midPoint); - writer.WritePackedVector2(endPoint); + writer.WriteVector2(midPoint); + writer.WriteVector2(endPoint); writer.Write(duration); } public override void ReceiveExtraAI(BinaryReader reader) { - midPoint = reader.ReadPackedVector2(); - endPoint = reader.ReadPackedVector2(); + midPoint = reader.ReadVector2(); + endPoint = reader.ReadVector2(); duration = reader.ReadInt32(); } } diff --git a/Content/Tiles/Underground/EvasionShrineBullets/Spear.cs b/Content/Tiles/Underground/EvasionShrineBullets/Spear.cs index bfc354911..72d810022 100644 --- a/Content/Tiles/Underground/EvasionShrineBullets/Spear.cs +++ b/Content/Tiles/Underground/EvasionShrineBullets/Spear.cs @@ -158,7 +158,7 @@ public override bool PreDraw(ref Color lightColor) public override void SendExtraAI(BinaryWriter writer) { - writer.WritePackedVector2(endPoint); + writer.WriteVector2(endPoint); writer.Write(timeToRise); writer.Write(timeToRetract); writer.Write(teleTime); @@ -167,7 +167,7 @@ public override void SendExtraAI(BinaryWriter writer) public override void ReceiveExtraAI(BinaryReader reader) { - endPoint = reader.ReadPackedVector2(); + endPoint = reader.ReadVector2(); timeToRise = reader.ReadInt32(); timeToRetract = reader.ReadInt32(); teleTime = reader.ReadInt32(); diff --git a/PATCH_NOTES.txt b/PATCH_NOTES.txt index 35dd3cd12..77c24a36f 100644 --- a/PATCH_NOTES.txt +++ b/PATCH_NOTES.txt @@ -1,8 +1,11 @@ # Starlight River 0.2.8.1 +## Multiplayer +- Various packet fixes for NPCs and projectiles in huge worlds + ## Fixes - Fixed the vitric pylon's debug item being sold by NPCs - Fixed the auroracle arena not being created in multiplayer - Fixed cutaways not allaigning themselves correctly after leaving a multiplayer game - Fixed incorrect textures on ceiros' platforms -- Fixed a crash that could occur related to lighting \ No newline at end of file +- Fixed a crash that could occur related to lighting