mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Merge pull request #7585 from ChillerDragon/pr_optional_tele
Make intersect TeleNr arg optional
This commit is contained in:
commit
0ffab44dea
|
@ -202,8 +202,7 @@ void CPlayers::RenderHookCollLine(
|
|||
DoBreak = true;
|
||||
}
|
||||
|
||||
int TeleNr = 0;
|
||||
int Hit = Collision()->IntersectLineTeleHook(OldPos, NewPos, &FinishPos, 0x0, &TeleNr);
|
||||
int Hit = Collision()->IntersectLineTeleHook(OldPos, NewPos, &FinishPos, 0x0);
|
||||
|
||||
if(!DoBreak && Hit)
|
||||
{
|
||||
|
|
|
@ -99,11 +99,9 @@ void CLaser::DoBounce()
|
|||
vec2 Coltile;
|
||||
|
||||
int Res;
|
||||
int z;
|
||||
|
||||
vec2 To = m_Pos + m_Dir * m_Energy;
|
||||
|
||||
Res = Collision()->IntersectLineTeleWeapon(m_Pos, To, &Coltile, &To, &z);
|
||||
Res = Collision()->IntersectLineTeleWeapon(m_Pos, To, &Coltile, &To);
|
||||
|
||||
if(Res)
|
||||
{
|
||||
|
|
|
@ -336,11 +336,14 @@ int CCollision::IntersectLineTeleHook(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision,
|
|||
int iy = round_to_int(Pos.y);
|
||||
|
||||
int Index = GetPureMapIndex(Pos);
|
||||
if(pTeleNr)
|
||||
{
|
||||
if(g_Config.m_SvOldTeleportHook)
|
||||
*pTeleNr = IsTeleport(Index);
|
||||
else
|
||||
*pTeleNr = IsTeleportHook(Index);
|
||||
if(*pTeleNr)
|
||||
}
|
||||
if(pTeleNr && *pTeleNr)
|
||||
{
|
||||
if(pOutCollision)
|
||||
*pOutCollision = Pos;
|
||||
|
@ -391,11 +394,14 @@ int CCollision::IntersectLineTeleWeapon(vec2 Pos0, vec2 Pos1, vec2 *pOutCollisio
|
|||
int iy = round_to_int(Pos.y);
|
||||
|
||||
int Index = GetPureMapIndex(Pos);
|
||||
if(pTeleNr)
|
||||
{
|
||||
if(g_Config.m_SvOldTeleportWeapons)
|
||||
*pTeleNr = IsTeleport(Index);
|
||||
else
|
||||
*pTeleNr = IsTeleportWeapon(Index);
|
||||
if(*pTeleNr)
|
||||
}
|
||||
if(pTeleNr && *pTeleNr)
|
||||
{
|
||||
if(pOutCollision)
|
||||
*pOutCollision = Pos;
|
||||
|
|
|
@ -39,8 +39,8 @@ public:
|
|||
int GetWidth() const { return m_Width; }
|
||||
int GetHeight() const { return m_Height; }
|
||||
int IntersectLine(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const;
|
||||
int IntersectLineTeleWeapon(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr) const;
|
||||
int IntersectLineTeleHook(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr) const;
|
||||
int IntersectLineTeleWeapon(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr = nullptr) const;
|
||||
int IntersectLineTeleHook(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision, int *pTeleNr = nullptr) const;
|
||||
void MovePoint(vec2 *pInoutPos, vec2 *pInoutVel, float Elasticity, int *pBounces) const;
|
||||
void MoveBox(vec2 *pInoutPos, vec2 *pInoutVel, vec2 Size, vec2 Elasticity, bool *pGrounded = nullptr) const;
|
||||
bool TestBox(vec2 Pos, vec2 Size) const;
|
||||
|
|
Loading…
Reference in a new issue