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

mv_fixbrokenmodels shouldn't affect team games #26

Closed
ghost opened this issue Jul 13, 2015 · 4 comments
Closed

mv_fixbrokenmodels shouldn't affect team games #26

ghost opened this issue Jul 13, 2015 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 13, 2015

Because the "broken" models can only be triggered in non-team games (skins are forced to either blue or red in team games on the clientside).
The problem is that if you enter "team_model morgan" in a team game when mv_fixbrokenmodels is enabled, you get kyle skin. There are some people like me who use the team_model command and rather not have to write "morgan/red" instead of morgan. Huge issue, I know. 😸

I suggest changing

if (mv_fixbrokenmodels->integer) {

to

if (mv_fixbrokenmodels->integer && g_gametype->integer < GT_TEAM) {
@ouned
Copy link
Member

ouned commented Jul 13, 2015

I guess the fix is still working then because there is no "broken" red/blue skin for morgan?
The only problem I'm seeing is that in theory the engine doesn't know how to interpret what g_gametype is (GT_TEAM could be redefined to anything) but that's most likely never happening.

@ghost
Copy link
Author

ghost commented Jul 13, 2015

typedef enum {
    GT_FFA,             // free for all
    GT_HOLOCRON,        // holocron ffa
    GT_JEDIMASTER,      // jedi master
    GT_TOURNAMENT,      // one on one tournament
    GT_SINGLE_PLAYER,   // single player ffa

    //-- team games go after this --

    GT_TEAM,            // team deathmatch
    GT_SAGA,            // saga
    GT_CTF,             // capture the flag
    GT_CTY,
    GT_MAX_GAME_TYPE
} gametype_t;

So it appears GT_TEAM == 5. Alternatively, include bg_public.h.
Yes, there is no broken red/blue skin for morgan, which is why this cvar should be disabled in team games. (similarly, kyle/fpls2 etc don't work in team games because skin is always forced clientside to red or blue in basejk.)

Oh, and g_gametype should be changed to sv_gametype in my suggestion for it to work.

@ouned
Copy link
Member

ouned commented Jul 13, 2015

yeah, of course, you can just include or define it but it (in a very strict way of thinking) isn't right. A mod could e.g. add another singleplayer gametype and jk2mv then would do weird stuff with it. That will not happen since it didnt the last 12 years but well...

What about removing the team_model checks completely? In case there is no broken team_model and /red /blue is automatically appended this should work, too:?

if (mv_fixbrokenmodels->integer) {
    char model[80];

    Q_strncpyz(model, Info_ValueForKey(cl->userinfo, "model"), sizeof(model));
    if (Q_stristr(model, "kyle/fpls") || (Q_stristr(model, "morgan") && (stricmp(model, "morgan/default_mp") && stricmp(model, "morgan/red") && stricmp(model, "morgan/blue"))))
            Info_SetValueForKey(cl->userinfo, "model", "kyle/default");
}

@ouned ouned closed this as completed in ba39b54 Jul 13, 2015
@ouned ouned added the bug label Jul 13, 2015
@ghost
Copy link
Author

ghost commented Jul 13, 2015

Yeah, good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant