-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 borgs being able to drink from buckets and spray bottles. #32964
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to run multiple checks, just use OR operator
if (!HasComp<BodyComponent>(target)) | ||
return false; | ||
|
||
if (HasComp<BorgChassisComponent>(target)) | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!HasComp<BodyComponent>(target) || (HasComp<BorgChassisComponent>(target))
return false;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it that way for readability reasons over code conciseness, but it's a simple change I can make.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still readable. Take a look at Content.Client/Doors/AirlockSystem.cs, line 93 for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think cyborgs should be hardcoded into the DrinkSystem. How does the FoodSystem handle this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think cyborgs should be hardcoded into the DrinkSystem. How does the FoodSystem handle this?
The food system checks for an UnremoveableComponent
and returns out of the TryFeed
method if it is present. All items given to borgs via ItemBorgModuleComponent
are given UnremoveableComponent
, which prevents them from eating. DrinkSystem
has no such check, should I use that approach instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also worth mentioning that the FoodSystem
checks for a StomachComponent
in the TryFeed
method, which borgs do not have, while the DrinkSystem
does not. If an entity gets past all the checks in TryDrink
, then it assumes it has a stomach to put the drink into, which is why the solution is deleted from existence in the case of borgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine now
I believe this should be done with an event, a while back I tried to do something similar.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and works as intended.
About the PR
Added additional logic to the drink system to prevent borgs with the regular or advanced cleaning module being able to drink the liquid inside buckets and spray bottles in their hand slots.
Why / Balance
Fixes #30775.
Technical details
DrinkSystem
TryDrink
now checks for if the entity attempting to drink is a borg.Media
janiborg_drink_fix_compressed.mp4
Requirements
Breaking changes
Changelog
🆑