Merge pull request #1670 from trml/pr_prediction_code_fixes

Fix #1668 and remove some code
This commit is contained in:
Dennis Felsing 2019-04-24 17:57:19 +02:00 committed by GitHub
commit 2415e72190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 18 deletions

View file

@ -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;

View file

@ -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);