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

Null checking the associated buff belonging to a DOT #325

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Null checking the associated buff belonging to a DOT #325

merged 2 commits into from
Dec 16, 2021

Conversation

Nebby1999
Copy link
Contributor

Fixes issue number #324, Simply checks if the BuffDef associated to the DOT exists, if not, continues adding it to the dot catalog as normal.

Debug.LogInfo message properly displays this change, with a new message that simply says "Custom Dot (Index: {dotDefIndex}) with no associated Buff added".

Also applied the same changes to the unrolled version, associatedBuff is now null by default and its not mandatory-

Copy link
Collaborator

@harbingerofme harbingerofme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the hell is this

Forgive my language, a bit tired.

The ternary statement that is very long doesn't make sense to use when all you are doing with it is immediately logging it and then discarding it.

I would love to either see a full blown if, or moving the ternary statement to use less than an entire line.

R2Api.Logger.logInfo($"Custom Dot (Index: {dotDefIndex} " + dotDef.associatedBuff == null ? "added." : $"that uses Buff : {dotDef.associatedBuff.name} added");

@harbingerofme harbingerofme added the Code smell Issue describes ugly code or bad code practices label Dec 15, 2021
@harbingerofme harbingerofme removed the Code smell Issue describes ugly code or bad code practices label Dec 15, 2021
@harbingerofme harbingerofme self-requested a review December 15, 2021 19:05
@tristanmcpherson tristanmcpherson merged commit 44503c2 into risk-of-thunder:master Dec 16, 2021
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.

4 participants