Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire and fire extinguisher #274

Closed
Chaos456456 opened this issue Feb 22, 2018 · 4 comments
Closed

Fire and fire extinguisher #274

Chaos456456 opened this issue Feb 22, 2018 · 4 comments
Assignees
Labels
Bug Something isn't working

Comments

@Chaos456456
Copy link

Chaos456456 commented Feb 22, 2018

#fire extingusher cant extinguish fire

@Mike-G5
Copy link

Mike-G5 commented Feb 23, 2018

Try standing farther away from the fire. They seem to work for me if I do that.

@NilanthAnimosus
Copy link
Collaborator

NilanthAnimosus commented Feb 23, 2018

The fire extinguisher code in 0.8.0.1 only checks the start and end of the raycast (Not the inside).

Commit 45ea91a on the command branch (Not part of 0.8.0.1) upgraded this to step through the raysize in 10% steps to collect any fires along the path of the raycast, Including some of this would improve the fires (I have tested this code myself)

However the code used there also brings in additional crashes, I had to add a try-catch around the repair tool code which improved the extinguisher due to bugs I can't explain which I will leave here:

Exception: Object reference not set to an instance of an object.
Target site: Void Repair(Microsoft.Xna.Framework.Vector2, Microsoft.Xna.Framework.Vector2, Single, Barotrauma.Character, Single, System.Collections.Generic.List1[FarseerPhysics.Dynamics.Body]) Stack trace: at Barotrauma.Items.Components.RepairTool.Repair(Vector2 rayStart, Vector2 rayEnd, Single deltaTime, Character user, Single degreeOfSuccess, List1 ignoredBodies) in F:\Barotrauma\BT NilEdit\Barotrauma---Nilanths-Edits\Barotrauma\BarotraumaShared\Source\Items\Components\Holdable\RepairTool.cs:line 167

Line 167 = for (float x = 0.0f; x <= Submarine.LastPickedFraction; x += 0.1f)

For the modification code I used it in early (As I could not understand how/why object reference was not set given these were floats, I used a try-catch to prevent this in case this is included as a warning).

@Regalis11
Copy link
Collaborator

They can fix fires, but the aiming logic is extremely inaccurate - you have to hit the "bounding box" at the base of the fire with an invisible ray that is cast from the position of the extinguisher. The fixes in the command branch should take care of this, I'll add them to the main branch for the next patch.

@NilanthAnimosus Are you sure that line number is correct? I don't see how that line could be causing null reference exceptions. I'm guessing/hoping the exceptions were actually caused by positions along the ray being outside hulls (which should be fixed in 4389a65).

@Regalis11 Regalis11 added the Bug Something isn't working label Feb 23, 2018
@Regalis11 Regalis11 self-assigned this Feb 23, 2018
@NilanthAnimosus
Copy link
Collaborator

Honestly I couldn't work out why, but it was added to 0.7.0.1 code. and I had not added parts from commit 4389a65 so it could have been fixed, it would only occur once every 2-3 rounds, perhaps 7 rounds. it was random but I would often wind up with the crash. the line number I didn't trust either but in case I threw a try-catch around it despite it making very little sense for a float or a class.

I only mentioned it as a precaution when I had tried that specific part of code out for my server-side mod. sadly I hadn't done much testing on the command branch to see if it occurred there but felt it was worth mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants