-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
plmenu: Fix another alive spectator bug #175
Conversation
Switch a newly connected user to spectator who selected his team but not his class can create an alive spectator if done during the first seconds of the round.
Executing a "joinclass" engclient_cmd should be enough to properly resolve this situation, allowing a team switch without bugs. |
Well, it was the case before. But i forgot something. |
So what happens exactly? Which mods does this problem occur on? For CS the joinclass method really should be enough. It may have to move to a different spot to work properly. |
It's the default plmenu who create this problem. At round start, normal players who join the party can spawn after the start of the round.This method doesn't work at all in fact, because if it's at round start, the spectator can still spawn. I don't think this is normal to let a spectator spawn. And the only reason why joinclass was here is to fix that. but if it's a failure, why keep it ? (if you don't use fakemeta, it's necessary to keep it to avoid to crash a player and probably a server) |
If I understand, with original code: a player chooses team, but not class. Round starts. An admin switches player to spectator. Player respawns because of joinclass 6 and that player is allowed to spawn at this point, then plugin tries to kill player, and does jointeam 6 to transfer to spectator. At this point you're saying that plugin failed to kill the spawned player, but jointeam worked, which result a spawned spectator, right? |
Player joins the server and selects a team (but not a model). Executing the joinclass command will set the model correctly for the team he is on. Crucially it also sets Here are some ideas for fixing the issue:
Of course this is only considering CS, and I don't know if there are possible issues with all of this in other mods, too. |
Solution with Disallowing could have been an okay solution if it was available for this short period of seconds where a player can respawn anytime. But all the time doesn't seem like a good idea as this can be forced without issues and this will probably annoy admins. Removing fakemeta code to enforce So to fix patch, I would remove the new block of code above, and adding the new offset. This should be okay this way. |
http://pastebin.com/j5vNXCDH |
I did not say to remove |
http://pastebin.com/nRc31SqG |
It works for me. I don't know if I test properly, but I do the following:
And I don't respawn and well in spectator team. |
Okay, so the problem is the plugin and a wrong if statement calling a block (cs_set_user_team block) rather the correct one. This part of the code seems to need more rewriting. |
Maybe you don't have fakemeta enabled ? :P |
I have fakemeta enabled, it's just that at the plugin current state, no jointeam 6 is called after or before m_iJoiningState JOINED and joinclass 6. It seems needed. |
I would say that because of Code is quite messy :/ |
I close this one for the moment. |
Switch a newly connected user to spectator who selected his team but not his class can create an alive spectator if done during the first seconds of the round.
Solution : block the team transfer for any people stuck in this menu.
Well it's the worst case and probably the only possible one to completely fix this issue.