diff --git a/datasrc/network.py b/datasrc/network.py index fadbc4f1e..a54c6efa0 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -6,7 +6,8 @@ GameFlags = ["TEAMS", "FLAGS"] GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED", "RACETIME"] CharacterFlags = ["SOLO", "JETPACK", "NO_COLLISION", "ENDLESS_HOOK", "ENDLESS_JUMP", "SUPER", "NO_HAMMER_HIT", "NO_SHOTGUN_HIT", "NO_GRENADE_HIT", "NO_RIFLE_HIT", "NO_HOOK", - "TELEGUN_GUN", "TELEGUN_GRENADE", "TELEGUN_LASER"] + "TELEGUN_GUN", "TELEGUN_GRENADE", "TELEGUN_LASER", + "WEAPON_HAMMER", "WEAPON_GUN", "WEAPON_SHOTGUN", "WEAPON_GRENADE", "WEAPON_LASER", "WEAPON_NINJA"] Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"] @@ -213,6 +214,8 @@ Objects = [ NetObjectEx("DDNetCharacter", "character@netobj.ddnet.tw", [ NetIntAny("m_Flags"), NetTick("m_FreezeEnd"), + NetIntRange("m_Jumps", 0, 255), + NetIntAny("m_TeleCheckpoint"), ]), ## Events diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index b6e2ecd92..c7e8fdd0d 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -1200,8 +1200,22 @@ void CCharacter::Snap(int SnappingClient) pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GRENADE; if(m_HasTeleLaser) pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_LASER; + if(m_aWeapons[WEAPON_HAMMER].m_Got) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_HAMMER; + if(m_aWeapons[WEAPON_GUN].m_Got) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_GUN; + if(m_aWeapons[WEAPON_SHOTGUN].m_Got) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_SHOTGUN; + if(m_aWeapons[WEAPON_GRENADE].m_Got) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_GRENADE; + if(m_aWeapons[WEAPON_RIFLE].m_Got) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_LASER; + if(m_Core.m_ActiveWeapon == WEAPON_NINJA) + pDDNetCharacter->m_Flags |= CHARACTERFLAG_WEAPON_NINJA; pDDNetCharacter->m_FreezeEnd = m_DeepFreeze ? -1 : m_FreezeTick + m_FreezeTime; + pDDNetCharacter->m_Jumps = m_Core.m_Jumps; + pDDNetCharacter->m_TeleCheckpoint = m_TeleCheckpoint; } int CCharacter::NetworkClipped(int SnappingClient)