mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #1670 from trml/pr_prediction_code_fixes
Fix #1668 and remove some code
This commit is contained in:
commit
2415e72190
|
@ -1071,15 +1071,12 @@ void CCharacter::Read(CNetObj_Character *pChar, CNetObj_DDNetCharacter *pExtende
|
|||
SetActiveWeapon(pChar->m_Weapon);
|
||||
}
|
||||
|
||||
if(!pExtended)
|
||||
if(pChar->m_Emote != EMOTE_PAIN && pChar->m_Emote != EMOTE_NORMAL)
|
||||
m_DeepFreeze = false;
|
||||
if(pChar->m_Weapon != WEAPON_NINJA || pChar->m_AttackTick > m_FreezeTick || absolute(pChar->m_VelX) == 256*10)
|
||||
{
|
||||
if(pChar->m_Emote != EMOTE_PAIN && pChar->m_Emote != EMOTE_NORMAL)
|
||||
m_DeepFreeze = false;
|
||||
if(pChar->m_Weapon != WEAPON_NINJA || pChar->m_AttackTick > m_FreezeTick || absolute(pChar->m_VelX) == 256*10)
|
||||
{
|
||||
m_DeepFreeze = false;
|
||||
UnFreeze();
|
||||
}
|
||||
m_DeepFreeze = false;
|
||||
UnFreeze();
|
||||
}
|
||||
if(!GameWorld()->m_WorldConfig.m_PredictFreeze)
|
||||
{
|
||||
|
@ -1153,13 +1150,6 @@ void CCharacter::Read(CNetObj_Character *pChar, CNetObj_DDNetCharacter *pExtende
|
|||
m_SuperJump = pExtended->m_Flags & CHARACTERFLAG_ENDLESS_JUMP;
|
||||
m_Jetpack = pExtended->m_Flags & CHARACTERFLAG_JETPACK;
|
||||
|
||||
if(GameWorld()->m_WorldConfig.m_PredictFreeze)
|
||||
m_DeepFreeze = pExtended->m_Flags & CHARACTERFLAG_DEEP_FROZEN;
|
||||
|
||||
bool Frozen = pExtended->m_Flags & CHARACTERFLAG_FROZEN;
|
||||
if(m_FreezeTime > 0 && !Frozen)
|
||||
UnFreeze();
|
||||
|
||||
m_Hit = HIT_ALL;
|
||||
if(pExtended->m_Flags & CHARACTERFLAG_NO_GRENADE_HIT)
|
||||
m_Hit |= DISABLE_HIT_GRENADE;
|
||||
|
|
|
@ -58,6 +58,8 @@ CEntity *CGameWorld::FindLast(int Type)
|
|||
|
||||
int CGameWorld::FindEntities(vec2 Pos, float Radius, CEntity **ppEnts, int Max, int Type)
|
||||
{
|
||||
if(!ppEnts)
|
||||
return 0;
|
||||
if(Type < 0 || Type >= NUM_ENTTYPES)
|
||||
return 0;
|
||||
|
||||
|
@ -66,8 +68,7 @@ int CGameWorld::FindEntities(vec2 Pos, float Radius, CEntity **ppEnts, int Max,
|
|||
{
|
||||
if(distance(pEnt->m_Pos, Pos) < Radius+pEnt->m_ProximityRadius)
|
||||
{
|
||||
if(ppEnts)
|
||||
ppEnts[Num] = pEnt;
|
||||
ppEnts[Num] = pEnt;
|
||||
Num++;
|
||||
if(Num == Max)
|
||||
break;
|
||||
|
@ -296,7 +297,7 @@ CEntity *CGameWorld::GetEntity(int ID, int EntType)
|
|||
void CGameWorld::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask)
|
||||
{
|
||||
// deal damage
|
||||
CCharacter *apEnts[MAX_CLIENTS];
|
||||
CCharacter *apEnts[MAX_CLIENTS] = {0};
|
||||
float Radius = 135.0f;
|
||||
float InnerRadius = 48.0f;
|
||||
int Num = FindEntities(Pos, Radius, (CEntity**)apEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
|
||||
|
|
Loading…
Reference in a new issue