mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Use freeze end tick instead of a flag. Fix #1659
This commit is contained in:
parent
8c85d0d2a7
commit
67668d7fb2
|
@ -6,8 +6,7 @@ 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",
|
||||
"FROZEN", "DEEP_FROZEN", "SPECTATING"]
|
||||
"TELEGUN_GUN", "TELEGUN_GRENADE", "TELEGUN_LASER"]
|
||||
|
||||
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]
|
||||
|
||||
|
@ -213,6 +212,7 @@ Objects = [
|
|||
|
||||
NetObjectEx("DDNetCharacter", "character@netobj.ddnet.tw", [
|
||||
NetIntAny("m_Flags"),
|
||||
NetTick("m_FreezeEnd"),
|
||||
]),
|
||||
|
||||
## Events
|
||||
|
|
|
@ -1145,10 +1145,10 @@ void CGameClient::OnNewSnapshot()
|
|||
pCharacterData->m_Flags & CHARACTERFLAG_ENDLESS_JUMP;
|
||||
|
||||
// Freeze
|
||||
m_aClients[Item.m_ID].m_Frozen = m_aClients[Item.m_ID].m_Predicted.m_Frozen =
|
||||
pCharacterData->m_Flags & CHARACTERFLAG_FROZEN;
|
||||
m_aClients[Item.m_ID].m_FreezeEnd = m_aClients[Item.m_ID].m_Predicted.m_FreezeEnd =
|
||||
pCharacterData->m_FreezeEnd;
|
||||
m_aClients[Item.m_ID].m_DeepFrozen = m_aClients[Item.m_ID].m_Predicted.m_DeepFrozen =
|
||||
pCharacterData->m_Flags & CHARACTERFLAG_DEEP_FROZEN;
|
||||
pCharacterData->m_FreezeEnd == -1;
|
||||
|
||||
// Telegun
|
||||
m_aClients[Item.m_ID].m_HasTelegunGrenade = m_aClients[Item.m_ID].m_Predicted.m_HasTelegunGrenade =
|
||||
|
@ -1157,9 +1157,6 @@ void CGameClient::OnNewSnapshot()
|
|||
pCharacterData->m_Flags & CHARACTERFLAG_TELEGUN_GUN;
|
||||
m_aClients[Item.m_ID].m_HasTelegunLaser = m_aClients[Item.m_ID].m_Predicted.m_HasTelegunLaser =
|
||||
pCharacterData->m_Flags & CHARACTERFLAG_TELEGUN_LASER;
|
||||
|
||||
// Other
|
||||
m_aClients[Item.m_ID].m_Spectating = pCharacterData->m_Flags & CHARACTERFLAG_SPECTATING;
|
||||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_SPECTATORINFO)
|
||||
{
|
||||
|
@ -1910,9 +1907,8 @@ void CGameClient::CClientData::Reset()
|
|||
m_HasTelegunGun = false;
|
||||
m_HasTelegunGrenade = false;
|
||||
m_HasTelegunLaser = false;
|
||||
m_Frozen = false;
|
||||
m_FreezeEnd = 0;
|
||||
m_DeepFrozen = false;
|
||||
m_Spectating = false;
|
||||
|
||||
UpdateRenderInfo();
|
||||
}
|
||||
|
|
|
@ -256,9 +256,8 @@ public:
|
|||
bool m_HasTelegunGun;
|
||||
bool m_HasTelegunGrenade;
|
||||
bool m_HasTelegunLaser;
|
||||
bool m_Frozen;
|
||||
int m_FreezeEnd;
|
||||
bool m_DeepFrozen;
|
||||
bool m_Spectating;
|
||||
|
||||
|
||||
CCharacterCore m_Predicted;
|
||||
|
|
|
@ -117,7 +117,7 @@ void CCharacterCore::Reset()
|
|||
m_HasTelegunGun = false;
|
||||
m_HasTelegunGrenade = false;
|
||||
m_HasTelegunLaser = false;
|
||||
m_Frozen = false;
|
||||
m_FreezeEnd = 0;
|
||||
m_DeepFrozen = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ public:
|
|||
bool m_HasTelegunGun;
|
||||
bool m_HasTelegunGrenade;
|
||||
bool m_HasTelegunLaser;
|
||||
bool m_Frozen;
|
||||
bool m_FreezeEnd;
|
||||
bool m_DeepFrozen;
|
||||
|
||||
void LimitForce(vec2 *Force);
|
||||
|
|
|
@ -1187,10 +1187,6 @@ void CCharacter::Snap(int SnappingClient)
|
|||
if(m_Jetpack || m_NinjaJetpack)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_JETPACK;
|
||||
if(m_FreezeTime > 0)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_FROZEN;
|
||||
if(m_DeepFreeze)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DEEP_FROZEN;
|
||||
if(m_Hit&DISABLE_HIT_GRENADE)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_NO_GRENADE_HIT;
|
||||
if(m_Hit&DISABLE_HIT_HAMMER)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_NO_HAMMER_HIT;
|
||||
|
@ -1198,14 +1194,14 @@ void CCharacter::Snap(int SnappingClient)
|
|||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_NO_RIFLE_HIT;
|
||||
if(m_Hit&DISABLE_HIT_SHOTGUN)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_NO_SHOTGUN_HIT;
|
||||
if(IsPaused())
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_SPECTATING;
|
||||
if(m_HasTeleGun)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GUN;
|
||||
if(m_HasTeleGrenade)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GRENADE;
|
||||
if(m_HasTeleLaser)
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_LASER;
|
||||
|
||||
pDDNetCharacter->m_FreezeEnd = m_DeepFreeze ? -1 : m_FreezeTick + m_FreezeTime;
|
||||
}
|
||||
|
||||
int CCharacter::NetworkClipped(int SnappingClient)
|
||||
|
|
Loading…
Reference in a new issue