mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
3493: Keep showing last checkpoint after kill r=heinrich5991 a=def- Some maps kill you quickly and you can't see how good your last run was, for example "Buckle Up". <!-- What is the motivation for the changes of this pull request --> ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) 3497: No network clip in client prediction r=heinrich5991 a=def- <!-- What is the motivation for the changes of this pull request --> ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
d0cdf23526
|
@ -877,15 +877,6 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
|
||||||
m_CheckpointTick = Client()->GameTick(g_Config.m_ClDummy);
|
m_CheckpointTick = Client()->GameTick(g_Config.m_ClDummy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(MsgType == NETMSGTYPE_SV_KILLMSG)
|
|
||||||
{
|
|
||||||
CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)pRawMsg;
|
|
||||||
if(pMsg->m_Victim == m_pClient->m_Snap.m_LocalClientID)
|
|
||||||
{
|
|
||||||
m_CheckpointTick = 0;
|
|
||||||
m_DDRaceTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(MsgType == NETMSGTYPE_SV_RECORD)
|
else if(MsgType == NETMSGTYPE_SV_RECORD)
|
||||||
{
|
{
|
||||||
CNetMsg_Sv_Record *pMsg = (CNetMsg_Sv_Record *)pRawMsg;
|
CNetMsg_Sv_Record *pMsg = (CNetMsg_Sv_Record *)pRawMsg;
|
||||||
|
|
|
@ -234,9 +234,3 @@ bool CProjectile::Match(CProjectile *pProj)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CProjectile::NetworkClipped(vec2 ViewPos)
|
|
||||||
{
|
|
||||||
float Ct = (GameWorld()->GameTick() - m_StartTick) / (float)GameWorld()->GameTickSpeed();
|
|
||||||
return ((CEntity *)this)->NetworkClipped(GetPos(Ct), ViewPos);
|
|
||||||
}
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ public:
|
||||||
const int &GetOwner() { return m_Owner; }
|
const int &GetOwner() { return m_Owner; }
|
||||||
const int &GetStartTick() { return m_StartTick; }
|
const int &GetStartTick() { return m_StartTick; }
|
||||||
CProjectile(CGameWorld *pGameWorld, int ID, CNetObj_Projectile *pProj);
|
CProjectile(CGameWorld *pGameWorld, int ID, CNetObj_Projectile *pProj);
|
||||||
virtual int NetworkClipped(vec2 ViewPos);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vec2 m_Direction;
|
vec2 m_Direction;
|
||||||
|
|
|
@ -33,24 +33,6 @@ CEntity::~CEntity()
|
||||||
GameWorld()->RemoveEntity(this);
|
GameWorld()->RemoveEntity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEntity::NetworkClipped(vec2 ViewPos)
|
|
||||||
{
|
|
||||||
return NetworkClipped(m_Pos, ViewPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEntity::NetworkClipped(vec2 CheckPos, vec2 ViewPos)
|
|
||||||
{
|
|
||||||
float dx = ViewPos.x - CheckPos.x;
|
|
||||||
float dy = ViewPos.y - CheckPos.y;
|
|
||||||
|
|
||||||
if(absolute(dx) > 1000.0f || absolute(dy) > 800.0f)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if(distance(ViewPos, CheckPos) > 4000.0f)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CEntity::GameLayerClipped(vec2 CheckPos)
|
bool CEntity::GameLayerClipped(vec2 CheckPos)
|
||||||
{
|
{
|
||||||
return round_to_int(CheckPos.x) / 32 < -200 || round_to_int(CheckPos.x) / 32 > Collision()->GetWidth() + 200 ||
|
return round_to_int(CheckPos.x) / 32 < -200 || round_to_int(CheckPos.x) / 32 > Collision()->GetWidth() + 200 ||
|
||||||
|
|
|
@ -54,8 +54,6 @@ public:
|
||||||
virtual void TickDefered() {}
|
virtual void TickDefered() {}
|
||||||
|
|
||||||
bool GameLayerClipped(vec2 CheckPos);
|
bool GameLayerClipped(vec2 CheckPos);
|
||||||
virtual int NetworkClipped(vec2 ViewPos);
|
|
||||||
virtual int NetworkClipped(vec2 CheckPos, vec2 ViewPos);
|
|
||||||
float m_ProximityRadius;
|
float m_ProximityRadius;
|
||||||
vec2 m_Pos;
|
vec2 m_Pos;
|
||||||
int m_Number;
|
int m_Number;
|
||||||
|
|
|
@ -485,14 +485,6 @@ void CGameWorld::NetObjEnd(int LocalID)
|
||||||
pHookedChar->m_KeepHooked = true;
|
pHookedChar->m_KeepHooked = true;
|
||||||
pHookedChar->m_MarkedForDestroy = false;
|
pHookedChar->m_MarkedForDestroy = false;
|
||||||
}
|
}
|
||||||
// keep entities that are out of view for a short while, for some entity types
|
|
||||||
if(CCharacter *pLocal = GetCharacterByID(LocalID))
|
|
||||||
for(int i : {ENTTYPE_CHARACTER, ENTTYPE_PROJECTILE, ENTTYPE_LASER})
|
|
||||||
for(CEntity *pEnt = FindFirst(i); pEnt; pEnt = pEnt->TypeNext())
|
|
||||||
if(pEnt->m_MarkedForDestroy)
|
|
||||||
if(pEnt->m_SnapTicks < 2 * SERVER_TICK_SPEED || (i != ENTTYPE_CHARACTER && pEnt->m_SnapTicks < 5 * SERVER_TICK_SPEED))
|
|
||||||
if(pEnt->NetworkClipped(pLocal->m_Core.m_Pos))
|
|
||||||
pEnt->m_MarkedForDestroy = false;
|
|
||||||
RemoveEntities();
|
RemoveEntities();
|
||||||
|
|
||||||
// Update character IDs and pointers
|
// Update character IDs and pointers
|
||||||
|
|
Loading…
Reference in a new issue