The bug still exists but i thought why keep checking for more tees in laser/door wait for 1 tee 1st

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
GreYFoXGTi 2010-08-31 08:43:44 +02:00
parent 15542a6c20
commit bd90c006e2
2 changed files with 61 additions and 50 deletions

View file

@ -30,8 +30,13 @@ void CDoor::Close()
bool CDoor::HitCharacter()
{
vec2 Points[36];
vec2 At;
CCharacter *Hit = GameServer()->m_World.IntersectCharacter(m_Pos, m_To, 1.f, At, 0);
if(Hit)
{
vec2 Points[36];
Hit->m_Doored = true;
Hit = 0;
for(int i=1;i<=36;i++)
{
Points[i-1].x = m_Pos.x * (1 - i/38.0) + m_To.x * i / 38.0;
@ -65,6 +70,7 @@ bool CDoor::HitCharacter()
Hit->m_Doored = true;
Hit = 0;
//hit->reset_pos();
}
return true;
}

View file

@ -28,13 +28,18 @@ CLight::CLight(CGameWorld *pGameWorld, vec2 Pos, float Rotation, int Length)
bool CLight::HitCharacter()
{
vec2 At;
CCharacter *Hit = GameServer()->m_World.IntersectCharacter(m_Pos, m_To, 1.f, At, 0);
if(Hit)
{
vec2 Points[36];
Hit->Freeze(Server()->TickSpeed()*3);
Hit = 0;
for(int i=1;i<37;i++)
{
Points[i-1].x = m_Pos.x * (1 - i/38.0) + m_To.x * i / 38.0;
Points[i-1].y = m_Pos.y * (1 - i/38.0) + m_To.y * i / 38.0;
}
CCharacter *Hit = GameServer()->m_World.IntersectCharacter(m_Pos, Points[0], 1.f, At, 0);
Hit = GameServer()->m_World.IntersectCharacter(m_Pos, Points[0], 1.f, At, 0);
if(Hit)
Hit->Freeze(Server()->TickSpeed()*3);
Hit = 0;
@ -61,7 +66,7 @@ bool CLight::HitCharacter()
if(Hit)
Hit->Freeze(Server()->TickSpeed()*3);
Hit = 0;
}
return true;
}