mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Now lights affects on all hitted characters as doors
This commit is contained in:
parent
3264c57306
commit
2214a3cd0a
|
@ -8,6 +8,7 @@ class CTrigger;
|
|||
class CDoor : public CEntity
|
||||
{
|
||||
vec2 m_To;
|
||||
int m_ActivatedTeam;
|
||||
int m_EvalTick;
|
||||
bool m_Opened;
|
||||
bool HitCharacter();
|
||||
|
|
|
@ -41,9 +41,7 @@ void CGun::Fire()
|
|||
for (int i = 0; i < Num; i++)
|
||||
{
|
||||
CCharacter *Target = Ents[i];
|
||||
int res=0;
|
||||
vec2 coltile;
|
||||
res = GameServer()->Collision()->IntersectLine(m_Pos, Target->m_Pos,0,0,false);
|
||||
int res = GameServer()->Collision()->IntersectLine(m_Pos, Target->m_Pos,0,0,false);
|
||||
if (!res)
|
||||
{
|
||||
int Len=length(Target->m_Pos - m_Pos);
|
||||
|
|
|
@ -28,10 +28,12 @@ CLight::CLight(CGameWorld *pGameWorld, vec2 pos, float rotation, int length)
|
|||
bool CLight::hit_character()
|
||||
{
|
||||
vec2 nothing;
|
||||
CCharacter *hit = GameServer()->m_World.IntersectCharacter(m_Pos, to, 0.0f, nothing, 0);
|
||||
if(!hit)
|
||||
return false;
|
||||
hit->Freeze(Server()->TickSpeed()*3);
|
||||
std::list < CCharacter * > hittedCharacters = GameServer()->m_World.IntersectedCharacters(m_Pos, to, 0.0f, nothing, 0);
|
||||
if(hittedCharacters.empty()) return false;
|
||||
for(std::list < CCharacter * >::iterator i = hittedCharacters.begin(); i != hittedCharacters.end(); i++) {
|
||||
CCharacter * Char = *i;
|
||||
Char->Freeze(Server()->TickSpeed()*3);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ void CGameContext::CreateExplosion(vec2 p, int Owner, int Weapon, bool NoDamage)
|
|||
float Dmg = 6 * l;
|
||||
if((int)Dmg)
|
||||
if((g_Config.m_SvHit||NoDamage) || Owner == apEnts[i]->m_pPlayer->GetCID())
|
||||
{
|
||||
{//TODO: Change which explosion affects only on one team
|
||||
if(Owner != -1 && apEnts[i]->m_Alive && apEnts[i]->Team() != GetPlayerChar(Owner)->Team()) continue;
|
||||
apEnts[i]->TakeDamage(ForceDir*Dmg*2, (int)Dmg, Owner, Weapon);
|
||||
if(!g_Config.m_SvHit||NoDamage) break;
|
||||
|
|
Loading…
Reference in a new issue