Add more fields to ddnetcharacter

This commit is contained in:
trml 2019-05-01 23:47:40 +02:00
parent 9bca330a73
commit ae57b7f205
2 changed files with 18 additions and 1 deletions

View file

@ -6,7 +6,8 @@ GameFlags = ["TEAMS", "FLAGS"]
GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED", "RACETIME"] GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED", "RACETIME"]
CharacterFlags = ["SOLO", "JETPACK", "NO_COLLISION", "ENDLESS_HOOK", "ENDLESS_JUMP", "SUPER", CharacterFlags = ["SOLO", "JETPACK", "NO_COLLISION", "ENDLESS_HOOK", "ENDLESS_JUMP", "SUPER",
"NO_HAMMER_HIT", "NO_SHOTGUN_HIT", "NO_GRENADE_HIT", "NO_RIFLE_HIT", "NO_HOOK", "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"] 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", [ NetObjectEx("DDNetCharacter", "character@netobj.ddnet.tw", [
NetIntAny("m_Flags"), NetIntAny("m_Flags"),
NetTick("m_FreezeEnd"), NetTick("m_FreezeEnd"),
NetIntRange("m_Jumps", 0, 255),
NetIntAny("m_TeleCheckpoint"),
]), ]),
## Events ## Events

View file

@ -1200,8 +1200,22 @@ void CCharacter::Snap(int SnappingClient)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GRENADE; pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GRENADE;
if(m_HasTeleLaser) if(m_HasTeleLaser)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_LASER; 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_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) int CCharacter::NetworkClipped(int SnappingClient)