From 7052d4e14e31328b5f14803b3aca20860f9a7e45 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 24 Feb 2014 16:18:10 -0600 Subject: [PATCH] Fixed: userinfo_t::SkinChanged() was unaware of player classes --- src/d_netinfo.cpp | 10 +++++----- src/d_player.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index d2dbc862de..41ad683fe1 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -387,7 +387,7 @@ void D_SetupUserInfo () { // Some cvars don't copy their original value directly. case NAME_Team: coninfo->TeamChanged(team); break; - case NAME_Skin: coninfo->SkinChanged(skin); break; + case NAME_Skin: coninfo->SkinChanged(skin, players[consoleplayer].CurrentPlayerClass); break; case NAME_Gender: coninfo->GenderChanged(gender); break; case NAME_PlayerClass: coninfo->PlayerClassChanged(playerclass); break; // The rest do. @@ -447,9 +447,9 @@ int userinfo_t::TeamChanged(int team) return team; } -int userinfo_t::SkinChanged(const char *skinname) +int userinfo_t::SkinChanged(const char *skinname, int playerclass) { - int skinnum = R_FindSkin(skinname, 0); + int skinnum = R_FindSkin(skinname, playerclass); *static_cast((*this)[NAME_Skin]) = skinnum; return skinnum; } @@ -821,7 +821,7 @@ void D_ReadUserInfoStrings (int pnum, BYTE **stream, bool update) break; case NAME_Skin: - info->SkinChanged(value); + info->SkinChanged(value, players[pnum].CurrentPlayerClass); if (players[pnum].mo != NULL) { if (players[pnum].cls != NULL && @@ -958,7 +958,7 @@ void ReadUserInfo(FArchive &arc, userinfo_t &info) switch (name) { case NAME_Team: info.TeamChanged(atoi(str)); break; - case NAME_Skin: info.SkinChanged(str); break; + case NAME_Skin: info.SkinChanged(str, 0); break; case NAME_PlayerClass: info.PlayerClassChanged(str); break; default: val.String = str; diff --git a/src/d_player.h b/src/d_player.h index f6f7674d77..e104a55b62 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -332,7 +332,7 @@ struct userinfo_t : TMap void Reset(); int TeamChanged(int team); - int SkinChanged(const char *skinname); + int SkinChanged(const char *skinname, int playerclass); int SkinNumChanged(int skinnum); int GenderChanged(const char *gendername); int PlayerClassChanged(const char *classname);