From 6352d952725d5c30fe88e4b1f26b4fc899da7312 Mon Sep 17 00:00:00 2001 From: Branan Purvine-Riley Date: Sun, 17 Apr 2011 14:14:07 -0700 Subject: [PATCH] Fix handling of custom avvies for internal clients --- Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp index 93506d9e..d4f10bf9 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp @@ -178,12 +178,17 @@ plKey plAvatarMgr::LoadAvatar(const char *name, const char *accountName, bool is const plLocation& maleLoc = plKeyFinder::Instance().FindLocation("GlobalAvatars", "Male"); const plLocation& custLoc = plKeyFinder::Instance().FindLocation("CustomAvatars", name); - // Silliness to make the compiler happy with const references. - // and don't allow players to use custom avatars - const plLocation& loc = (globalLoc.IsValid() ? globalLoc : isPlayer ? maleLoc : custLoc); +#ifdef PLASMA_EXTERNAL_RELEASE + // Try global. If that doesn't work, players default to male. + // If not a player, try custLoc. If that doesn't work, fall back to male + const plLocation& loc = (globalLoc.IsValid() ? globalLoc : isPlayer ? maleLoc : custLoc.IsValid() ? custLoc : maleLoc); +#else + // Try global. If that doesn't work try custom. Otherwise fall back to male + const plLocation& loc = (globalLoc.IsValid() ? globalLoc : custLoc.IsValid() ? custLoc : maleLoc); +#endif const char* theName = name; - if ( isPlayer && !globalLoc.IsValid() ) + if ( loc == maleLoc ) theName = "Male"; if (loc.IsValid())