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 crash when player is in a special team #866

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

LightBlueCube
Copy link
Contributor

@LightBlueCube LightBlueCube commented Sep 4, 2024

QQ图片20240905070404

my English is bad, im sorry for that :(

@Zanieon Zanieon added needs testing Changes from the PR still need to be tested waiting on changes by author Waiting on PR author to implement the suggested changes labels Sep 5, 2024
@LightBlueCube
Copy link
Contributor Author

LightBlueCube commented Sep 5, 2024

idk if im doing right
thx for the review

@Zanieon Zanieon removed the waiting on changes by author Waiting on PR author to implement the suggested changes label Sep 5, 2024
Copy link
Contributor

@Zanieon Zanieon left a comment

Choose a reason for hiding this comment

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

Code looks good, and this will probably solve problems in regards to any gamemode isn't 2 sided based, or even if they partially uses Militia or IMC teams, it will work only between those teams.

@GeckoEidechse
Copy link
Member

Uh, what's the command to switch player teams again so that I can test this? ^^"

@Zanieon
Copy link
Contributor

Zanieon commented Sep 6, 2024

Uh, what's the command to switch player teams again so that I can test this? ^^"

There's no default way of doing it right now, you can only do either by using FSU and typing !switch in chat, or using my FD branch and typing changeteam in console.

@F1F7Y
Copy link
Member

F1F7Y commented Sep 6, 2024

You could also do smth like script SetTeam(GetPlayerArray()[0], GetOtherTeam(GetPlayerArray()[0].GetTeam())) ( <- this prob dont work as i dont remember the exact funcs )

@LightBlueCube
Copy link
Contributor Author

Uh, what's the command to switch player teams again so that I can test this? ^^"

u can try use this function

void function SetTeam( entity ent, int team )

just like this comment

You could also do smth like script SetTeam(GetPlayerArray()[0], GetOtherTeam(GetPlayerArray()[0].GetTeam())) ( <- this prob dont work as i dont remember the exact funcs )

here is some team name u may need to know
TEAM_ANY, TEAM_INVALID, TEAM_UNASSIGNED, TEAM_SPECTATOR, TEAM_IMC, TEAM_MILITIA, TEAM_BOTH

@GeckoEidechse GeckoEidechse self-assigned this Sep 9, 2024
@Zanieon
Copy link
Contributor

Zanieon commented Sep 9, 2024

Tested this by using #872 and playing Free For All, so far server didn't complain, and probably it wouldn't as there's sanity checks in that team changing code.

Besides... Only FFA Scoreboard supports more than 2 teams, all other gamemodes will crash clients that tries to open Scoreboard if trying to assign players to other than TEAM_MILITIA or TEAM_IMC teams

I also have to mention that i prefer this to get merged first over #875 so i can update the function there manually as Github probably will get confused and do a merge conflict for either PRs that gets merged last.

@GeckoEidechse GeckoEidechse removed the needs testing Changes from the PR still need to be tested label Sep 9, 2024
@GeckoEidechse
Copy link
Member

Merging based on reviews, thanks @Zanieon

@GeckoEidechse GeckoEidechse changed the title fix crash when player got a special team Fix crash when player is in a special team Sep 9, 2024
@GeckoEidechse GeckoEidechse merged commit ee33fd3 into R2Northstar:main Sep 9, 2024
3 checks passed
@GeckoEidechse GeckoEidechse removed their assignment Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants