Fixed bullet wall stuck when de activated and collides with a tee

This commit is contained in:
GreYFoXGTi 2010-11-14 11:36:00 +02:00
parent 2d7eae757e
commit bf0b4183cc
2 changed files with 25 additions and 3 deletions

View file

@ -311,7 +311,28 @@ int CCollision::Entity(int x, int y, int Layer)
{
if((0 > x || x >= m_Width) || (0 > y || y >= m_Height))
{
dbg_msg("CCollision::Entity","Something is VERY wrong please report this at github");
char aBuf[12];
switch (Layer)
{
case LAYER_GAME:
str_format(aBuf,sizeof(aBuf), "Game");
break;
case LAYER_FRONT:
str_format(aBuf,sizeof(aBuf), "Front");
break;
case LAYER_SWITCH:
str_format(aBuf,sizeof(aBuf), "Switch");
break;
case LAYER_TELE:
str_format(aBuf,sizeof(aBuf), "Tele");
break;
case LAYER_SPEEDUP:
str_format(aBuf,sizeof(aBuf), "Speedup");
break;
default:
str_format(aBuf,sizeof(aBuf), "Unknown");
}
dbg_msg("CCollision::Entity","Something is VERY wrong in the layer %s please report this at http://DDRace.info, but you may haven't read the news section so go there and read first", aBuf);
return 0;
}
switch (Layer)

View file

@ -95,7 +95,6 @@ void CProjectile::Tick()
OwnerChar = GameServer()->GetPlayerChar(m_Owner);
CCharacter *TargetChr = GameServer()->m_World.IntersectCharacter(PrevPos, ColPos, (m_Freeze) ? 1.0f : 6.0f, ColPos, OwnerChar);
if(TargetChr && m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[TargetChr->Team()]) return;
if(m_LifeSpan > -1)
m_LifeSpan--;
@ -128,7 +127,7 @@ void CProjectile::Tick()
GameServer()->CreateSound(ColPos, m_SoundImpact,
(m_Owner != -1)? TeamMask : -1);
}
else if(TargetChr && m_Freeze)
else if(TargetChr && m_Freeze && ((m_Layer == LAYER_SWITCH && GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[TargetChr->Team()]) || m_Layer != LAYER_SWITCH))
TargetChr->Freeze(Server()->TickSpeed()*3);
if(Collide && m_Bouncing != 0)
{
@ -172,6 +171,8 @@ void CProjectile::Snap(int SnappingClient)
if(NetworkClipped(SnappingClient, GetPos(Ct)))
return;
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
if (!GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()]) return;
if
(
SnapChar &&