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

ciggie sounds #32426

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

Conversation

deltanedas
Copy link
Contributor

About the PR

plays a sound when lighting a ciggie or it goes out

Why / Balance

good

Technical details

replaced _active hashset with BurningComponent to track actively lit ciggies

Media

it work

Requirements

@baddiePRO
Copy link

gone are the days of me looking like an idiot trying to smoke a cigarette butt

@lzk228
Copy link
Contributor

lzk228 commented Sep 24, 2024

no media?

@deltanedas
Copy link
Contributor Author

trust

Comment on lines 73 to +80
if (state == SmokableState.Lit)
_active.Add(uid);
EnsureComp<BurningComponent>(uid);
else
_active.Remove(uid);
RemComp<BurningComponent>(uid);

var sound = state == SmokableState.Lit
? smokable.LightSound
: smokable.SnuffSound;
Copy link
Contributor

@Centronias Centronias Oct 15, 2024

Choose a reason for hiding this comment

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

Suggested change
if (state == SmokableState.Lit)
_active.Add(uid);
EnsureComp<BurningComponent>(uid);
else
_active.Remove(uid);
RemComp<BurningComponent>(uid);
var sound = state == SmokableState.Lit
? smokable.LightSound
: smokable.SnuffSound;
SoundSpecifier? sound = null;
if (state == SmokableState.Lit)
{
EnsureComp<BurningComponent>(uid);
sound = smokable.LightSound;
}
else
{
RemComp<BurningComponent>(uid);
sound = smokable.SnuffSound;
}

considering the if and ternary have the same condition.

edit: realized I butchered the var sound bit -- I am not sure exactly what I've edited to is correct either, but you get the idea.

@ps3moira
Copy link
Contributor

tryna smoke here

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.

5 participants