Merge pull request #7134 from infclass/for-ddnet3

Mod Support: Add NINJA_SKIN_FOR_FROZEN game info flag
This commit is contained in:
Robert Müller 2023-09-10 08:32:43 +00:00 committed by GitHub
commit e8f17aade1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View file

@ -26,7 +26,7 @@ GameInfoFlags = [
]
GameInfoFlags2 = [
"ALLOW_X_SKINS", "GAMETYPE_CITY", "GAMETYPE_FDDRACE", "ENTITIES_FDDRACE", "HUD_HEALTH_ARMOR", "HUD_AMMO",
"HUD_DDRACE", "NO_WEAK_HOOK"
"HUD_DDRACE", "NO_WEAK_HOOK", "NO_SKIN_CHANGE_FOR_FROZEN"
]
ExPlayerFlags = ["AFK", "PAUSED", "SPEC"]
LegacyProjectileFlags = [f"CLIENTID_BIT{i}" for i in range(8)] + [
@ -71,7 +71,7 @@ enum
enum
{
GAMEINFO_CURVERSION=8,
GAMEINFO_CURVERSION=9,
};
'''

View file

@ -763,7 +763,8 @@ void CPlayers::OnRender()
m_aRenderInfo[i].m_TeeRenderFlags |= TEE_EFFECT_FROZEN;
const CGameClient::CSnapState::CCharacterInfo &CharacterInfo = m_pClient->m_Snap.m_aCharacters[i];
if((CharacterInfo.m_Cur.m_Weapon == WEAPON_NINJA || (CharacterInfo.m_HasExtendedData && CharacterInfo.m_ExtendedData.m_FreezeEnd != 0)) && g_Config.m_ClShowNinja)
const bool Frozen = CharacterInfo.m_HasExtendedData && CharacterInfo.m_ExtendedData.m_FreezeEnd != 0;
if((CharacterInfo.m_Cur.m_Weapon == WEAPON_NINJA || (Frozen && !m_pClient->m_GameInfo.m_NoSkinChangeForFrozen)) && g_Config.m_ClShowNinja)
{
// change the skin for the player to the ninja
const auto *pSkin = m_pClient->m_Skins.FindOrNullptr("x_ninja");

View file

@ -1188,6 +1188,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
Info.m_HudAmmo = true;
Info.m_HudDDRace = false;
Info.m_NoWeakHookAndBounce = false;
Info.m_NoSkinChangeForFrozen = false;
if(Version >= 0)
{
@ -1243,6 +1244,11 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
{
Info.m_NoWeakHookAndBounce = Flags2 & GAMEINFOFLAG2_NO_WEAK_HOOK;
}
if(Version >= 9)
{
Info.m_NoSkinChangeForFrozen = Flags2 & GAMEINFOFLAG2_NO_SKIN_CHANGE_FOR_FROZEN;
}
return Info;
}

View file

@ -96,6 +96,7 @@ public:
bool m_HudDDRace;
bool m_NoWeakHookAndBounce;
bool m_NoSkinChangeForFrozen;
};
class CSnapEntities