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

Fix shards not needing a lit welder #27959

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Vermidia
Copy link
Contributor

@Vermidia Vermidia commented May 12, 2024

About the PR

Fixes shards being weldable with an unlit welder.

Why / Balance

🐛, there was a discord issue on this but it's gone now.

Technical details

CanStartToolUse now checks if the tool has a WelderComponent with an outs parameter that'll make sure the AttemptFrequency is always EveryTick if the tool needs fuel or the interaction requires a certain amount of fuel.

Media

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Shouldn't be

Changelog

🆑

  • fix: Glass shards are no longer weldable with an unlit welder.

@EmoGarbage404
Copy link
Member

shouldn't the welder code be checking for fuel regardless of if there is any cost to refine? Like if there's 0 fuel then won't it run out while refining?

@Vermidia
Copy link
Contributor Author

I think it's a problem with the SharedToolSystem in this case

var doAfterArgs = new DoAfterArgs(EntityManager, user, delay / toolComponent.SpeedModifier, toolEvent, tool, target: target, used: tool)
 {
     BreakOnDamage = true,
     BreakOnMove = true,
     BreakOnWeightlessMove = false,
     NeedHand = tool != user,
     AttemptFrequency = fuel > 0 ? AttemptFrequency.EveryTick : AttemptFrequency.Never
 };

Since it's 0, it never raises an event.

@EmoGarbage404
Copy link
Member

SharedToolSystem.CanStartToolUse should still be checking that. Probably should be under ToolUseAttemptEvent.

@Vermidia
Copy link
Contributor Author

Changed it so fuel is passed into ToolUseAttemptEvent, and that SharedToolSystem.Welder uses that event for its OnWelderToolUseAttempt. This fixes it and still makes it work for other things (construction, borg welding), with the small cavet that the pop-up messages don't seem to appear? This happens with the borg and glass shards.

@Vermidia Vermidia marked this pull request as draft May 13, 2024 05:47
@Vermidia Vermidia marked this pull request as ready for review May 13, 2024 06:37
@Vermidia
Copy link
Contributor Author

Disregard the previous attempt, it broke things. Simplified it into simply adding a check in CanStartToolUse for the component and outting and checking that for AttemptFrequency as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants