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

Makes sabotaged things respect friendly fire setting #363

Merged
merged 4 commits into from Nov 1, 2018
Merged

Makes sabotaged things respect friendly fire setting #363

merged 4 commits into from Nov 1, 2018

Conversation

DexterHaslem
Copy link
Contributor

This makes sentry gun and dispenser damage given/received check friendly fire is on in respect to the saboteur's team. fixes #327

I cannot spell saboteur correctly

@DexterHaslem
Copy link
Contributor Author

this might cover #273 as well, I will check if that explosion code checks the same gamerules code

@DexterHaslem
Copy link
Contributor Author

oh great, this doesnt work for malicious sabotage of SG because no saboteur info is set in that case to distinguish them. I need to change that code to have a proper flag and still keep track of sab team first.. this is WIP

@squeek502
Copy link
Member

I'm not really seeing how #327 was happening in the first place. It looks like the previous code was essentially, "if an SG is sabotaged, anyone can damage it," and IsSabotaged() is a prereq of IsMaliciouslySabotaged(), which means that IsSabotaged() must include maliciously sabotaged SGs, right? So I'm confused. Did you confirm #327 was real?

game_shared/ff/ff_gamerules.cpp Outdated Show resolved Hide resolved
game_shared/ff/ff_gamerules.cpp Outdated Show resolved Hide resolved
@DexterHaslem
Copy link
Contributor Author

It definitely exists (just sab a SG then shoot it), thats what i was trying to address. I assumed the sabotage properties would always be set on the buildable base class, which is not true, I think. I will re-test

@squeek502
Copy link
Member

Where does FCanTakeDamage return false in that instance (when trying to damage your maliciously sabotaged SG)? Or is it something else that's affecting things?

@DexterHaslem
Copy link
Contributor Author

The previous code always returned true if it was sabotaged, is that what you are asking?

@squeek502
Copy link
Member

Yeah, but if that's true, shouldn't it be impossible for there to be a bug where a (maliciously) sabotaged SG couldn't be damaged? Maybe I'm misunderstanding what #327 is saying?

@DexterHaslem
Copy link
Contributor Author

Indeed, it's saying it could be damaged by the sabotuer which arguably doesn't make sense when friendly fire is on. this really comes down to a gameplay decision:

do sabotaged buildings 'belong' to the sabotaging team? I would not be surprised if the original devs intentionally made them 'building versus the world' when sabd

@squeek502
Copy link
Member

squeek502 commented Oct 11, 2018

Ohhh, ok I get it. The spy (and their team) can damage the gun they have maliciously sabotaged when FF is off. The title of #327 is (edit: was) super confusing.

@DexterHaslem
Copy link
Contributor Author

True that! I'm traveling and will finish this up after next week

@DexterHaslem
Copy link
Contributor Author

I debugged through this, didnt understand how sabotaging works - m_hSaboteur is always set so disregard that. I will refactor the duplicated sentry/dispenser stuff then this should be good to go

@DexterHaslem
Copy link
Contributor Author

just tested it , works more gooder. also learned you can safely pass NULL to dynamic cast, so i'm just doing that to check it's a buildable

@DexterHaslem DexterHaslem merged commit 8d6fcd7 into fortressforever:beta Nov 1, 2018
@DexterHaslem DexterHaslem deleted the fix-ff-sabotaged-buidables branch November 1, 2018 19:51
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.

Sabotaging spy (and their team) can damage own sabotaged SG if friendly fire is off
2 participants