FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.77k stars 408 forks source link

Husk limb causes crash with no report if removed while attacking #14923

Closed Regalis11 closed 4 weeks ago

Regalis11 commented 1 month ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14919

Originally posted by **4-S-H** October 23, 2024 ### Disclaimers - [X] I have searched the issue tracker to check if the issue has already been reported. - [ ] My issue happened while using mods. ### What happened? could be related to https://github.com/FakeFishGames/Barotrauma/discussions/14819 If a human with active husk infection has their infection cured while they are attacking, the game crashes immediately without producing a crash report. The crash was first discovered with modded human appendages and with a crash report (sometimes it is produced and sometimes not), which is attached below. I reproduced the crash in vanilla conditions. ### Reproduction steps 1. start a round 2. give someone active husk infection and let them attack something 3. inject calyxanide while they are shooting 4. the game crashes immediately ### Bug prevalence Just once ### Single player or multiplayer? Single player ### - _No response_ ### Version v1.6.17.0 (Unto the Breach Update) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports ```text Exception: Object reference not set to an instance of an object. (System.NullReferenceException) Target site: FarseerPhysics.Dynamics.Body b__123_0(Barotrauma.Limb) Stack trace: at Barotrauma.AIObjectiveCombat.<>c.b__123_0(Limb l) in \Barotrauma\BarotraumaShared\SharedSource\Characters\AI\Objectives\AIObjectiveCombat.cs:line 1378 at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext() at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer) at Barotrauma.Submarine.CheckFixtureCollision(Fixture fixture, IEnumerable`1 ignoredBodies, Nullable`1 collisionCategory, Boolean ignoreSensors, Predicate`1 customPredicate) in \Barotrauma\BarotraumaShared\SharedSource\Map\Submarine.cs:line 971 at Barotrauma.Submarine.<>c__DisplayClass171_0.b__0(Fixture fixture, Vector2 point, Vector2 normal, Single fraction) in \Barotrauma\BarotraumaShared\SharedSource\Map\Submarine.cs:line 913 at FarseerPhysics.Dynamics.World.RayCastCallbackWrapper(RayCastInput rayCastInput, FixtureProxy proxy) in E:\Barotrauma-development\Libraries\Farseer Physics Engine 3.5\Dynamics\World.cs:line 220 at FarseerPhysics.Collision.DynamicTree`1.RayCast(IBroadPhase broadPhase, Func`3 callback, RayCastInput& input, Category collisionCategory) in E:\Barotrauma-development\Libraries\Farseer Physics Engine 3.5\Collision\DynamicTree.cs:line 490 at FarseerPhysics.Collision.DynamicTreeBroadPhase.RayCast(Func`3 callback, RayCastInput& input, Category collisionCategory) in E:\Barotrauma-development\Libraries\Farseer Physics Engine 3.5\Collision\DynamicTreeBroadPhase.cs:line 333 at Barotrauma.Submarine.PickBodies(Vector2 rayStart, Vector2 rayEnd, IEnumerable`1 ignoredBodies, Nullable`1 collisionCategory, Boolean ignoreSensors, Predicate`1 customPredicate, Boolean allowInsideFixture) in \Barotrauma\BarotraumaShared\SharedSource\Map\Submarine.cs:line 939 at Barotrauma.AIObjectiveCombat.Attack(Single deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Characters\AI\Objectives\AIObjectiveCombat.cs:line 1380 at Barotrauma.AIObjectiveCombat.Act(Single deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Characters\AI\Objectives\AIObjectiveCombat.cs:line 350 at Barotrauma.HumanAIController.Update(Single deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Characters\AI\HumanAIController.cs:line 465 at Barotrauma.Character.UpdateAll_Patch1(Single deltaTime, Camera cam) at Barotrauma.GameScreen.Update(Double deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Screens\GameScreen.cs:line 184 at Barotrauma.GameMain.Update_Patch1(GameMain this, GameTime gameTime) at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in E:\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656 at Microsoft.Xna.Framework.Game.Tick() in E:\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500 at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in E:\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93 at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in E:\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397 at Microsoft.Xna.Framework.Game.Run() in E:\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367 at Barotrauma.Program.Main(String[] args) in \Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 61 ```
Regalis11 commented 4 weeks ago

Merged, closing