mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7134 from infclass/for-ddnet3
Mod Support: Add NINJA_SKIN_FOR_FROZEN game info flag
This commit is contained in:
commit
e8f17aade1
|
@ -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,
|
||||
};
|
||||
'''
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
bool m_HudDDRace;
|
||||
|
||||
bool m_NoWeakHookAndBounce;
|
||||
bool m_NoSkinChangeForFrozen;
|
||||
};
|
||||
|
||||
class CSnapEntities
|
||||
|
|
Loading…
Reference in a new issue