mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
use TeamMask() instead of Teams()->TeamMask(...)
This commit is contained in:
parent
b8cbd8120c
commit
459a845373
|
@ -107,7 +107,7 @@ void CCharacter::SetWeapon(int W)
|
|||
m_LastWeapon = m_Core.m_ActiveWeapon;
|
||||
m_QueuedWeapon = -1;
|
||||
m_Core.m_ActiveWeapon = W;
|
||||
GameServer()->CreateSound(m_Pos, SOUND_WEAPON_SWITCH, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_WEAPON_SWITCH, TeamMask());
|
||||
|
||||
if(m_Core.m_ActiveWeapon < 0 || m_Core.m_ActiveWeapon >= NUM_WEAPONS)
|
||||
m_Core.m_ActiveWeapon = 0;
|
||||
|
@ -204,7 +204,7 @@ void CCharacter::HandleNinja()
|
|||
|
||||
if(NinjaTime % Server()->TickSpeed() == 0 && NinjaTime / Server()->TickSpeed() <= 5)
|
||||
{
|
||||
GameServer()->CreateDamageInd(m_Pos, 0, NinjaTime / Server()->TickSpeed(), Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateDamageInd(m_Pos, 0, NinjaTime / Server()->TickSpeed(), TeamMask());
|
||||
}
|
||||
|
||||
m_Armor = clamp(10 - (NinjaTime / 15), 0, 10);
|
||||
|
@ -270,7 +270,7 @@ void CCharacter::HandleNinja()
|
|||
continue;
|
||||
|
||||
// Hit a player, give him damage and stuffs...
|
||||
GameServer()->CreateSound(aEnts[i]->m_Pos, SOUND_NINJA_HIT, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(aEnts[i]->m_Pos, SOUND_NINJA_HIT, TeamMask());
|
||||
// set his velocity to fast upward (for now)
|
||||
if(m_NumObjectsHit < 10)
|
||||
m_apHitObjects[m_NumObjectsHit++] = aEnts[i];
|
||||
|
@ -385,7 +385,7 @@ void CCharacter::FireWeapon()
|
|||
if(m_PainSoundTimer <= 0 && !(m_LatestPrevInput.m_Fire & 1))
|
||||
{
|
||||
m_PainSoundTimer = 1 * Server()->TickSpeed();
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, TeamMask());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ void CCharacter::FireWeapon()
|
|||
{
|
||||
// reset objects Hit
|
||||
m_NumObjectsHit = 0;
|
||||
GameServer()->CreateSound(m_Pos, SOUND_HAMMER_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_HAMMER_FIRE, TeamMask());
|
||||
|
||||
Antibot()->OnHammerFire(m_pPlayer->GetCID());
|
||||
|
||||
|
@ -429,9 +429,9 @@ void CCharacter::FireWeapon()
|
|||
|
||||
// set his velocity to fast upward (for now)
|
||||
if(length(pTarget->m_Pos - ProjStartPos) > 0.0f)
|
||||
GameServer()->CreateHammerHit(pTarget->m_Pos - normalize(pTarget->m_Pos - ProjStartPos) * GetProximityRadius() * 0.5f, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateHammerHit(pTarget->m_Pos - normalize(pTarget->m_Pos - ProjStartPos) * GetProximityRadius() * 0.5f, TeamMask());
|
||||
else
|
||||
GameServer()->CreateHammerHit(ProjStartPos, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateHammerHit(ProjStartPos, TeamMask());
|
||||
|
||||
vec2 Dir;
|
||||
if(length(pTarget->m_Pos - m_Pos) > 0.0f)
|
||||
|
@ -498,7 +498,7 @@ void CCharacter::FireWeapon()
|
|||
-1 //SoundImpact
|
||||
);
|
||||
|
||||
GameServer()->CreateSound(m_Pos, SOUND_GUN_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_GUN_FIRE, TeamMask());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -530,7 +530,7 @@ void CCharacter::FireWeapon()
|
|||
LaserReach = GameServer()->TuningList()[m_TuneZone].m_LaserReach;
|
||||
|
||||
new CLaser(&GameServer()->m_World, m_Pos, Direction, LaserReach, m_pPlayer->GetCID(), WEAPON_SHOTGUN);
|
||||
GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE, TeamMask());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -555,7 +555,7 @@ void CCharacter::FireWeapon()
|
|||
SOUND_GRENADE_EXPLODE //SoundImpact
|
||||
); //SoundImpact
|
||||
|
||||
GameServer()->CreateSound(m_Pos, SOUND_GRENADE_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_GRENADE_FIRE, TeamMask());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -568,7 +568,7 @@ void CCharacter::FireWeapon()
|
|||
LaserReach = GameServer()->TuningList()[m_TuneZone].m_LaserReach;
|
||||
|
||||
new CLaser(GameWorld(), m_Pos, Direction, LaserReach, m_pPlayer->GetCID(), WEAPON_LASER);
|
||||
GameServer()->CreateSound(m_Pos, SOUND_LASER_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_LASER_FIRE, TeamMask());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -581,7 +581,7 @@ void CCharacter::FireWeapon()
|
|||
m_Core.m_Ninja.m_CurrentMoveTime = g_pData->m_Weapons.m_Ninja.m_Movetime * Server()->TickSpeed() / 1000;
|
||||
m_Core.m_Ninja.m_OldVelAmount = length(m_Core.m_Vel);
|
||||
|
||||
GameServer()->CreateSound(m_Pos, SOUND_NINJA_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_NINJA_FIRE, TeamMask());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ void CCharacter::GiveNinja()
|
|||
m_Core.m_ActiveWeapon = WEAPON_NINJA;
|
||||
|
||||
if(!m_Core.m_aWeapons[WEAPON_NINJA].m_Got)
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PICKUP_NINJA, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PICKUP_NINJA, TeamMask());
|
||||
}
|
||||
|
||||
void CCharacter::RemoveNinja()
|
||||
|
@ -912,7 +912,7 @@ void CCharacter::Die(int Killer, int Weapon)
|
|||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
|
||||
// a nice sound
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_DIE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_DIE, TeamMask());
|
||||
|
||||
// this is to rate limit respawning to 3 secs
|
||||
m_pPlayer->m_PreviousDieTick = m_pPlayer->m_DieTick;
|
||||
|
@ -923,7 +923,7 @@ void CCharacter::Die(int Killer, int Weapon)
|
|||
|
||||
GameServer()->m_World.RemoveEntity(this);
|
||||
GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()] = 0;
|
||||
GameServer()->CreateDeath(m_Pos, m_pPlayer->GetCID(), Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateDeath(m_Pos, m_pPlayer->GetCID(), TeamMask());
|
||||
Teams()->OnCharacterDeath(GetPlayer()->GetCID(), Weapon);
|
||||
}
|
||||
|
||||
|
@ -2092,7 +2092,7 @@ void CCharacter::DDRaceTick()
|
|||
{
|
||||
if(m_FreezeTime % Server()->TickSpeed() == Server()->TickSpeed() - 1 || m_FreezeTime == -1)
|
||||
{
|
||||
GameServer()->CreateDamageInd(m_Pos, 0, (m_FreezeTime + 1) / Server()->TickSpeed(), Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateDamageInd(m_Pos, 0, (m_FreezeTime + 1) / Server()->TickSpeed(), TeamMask());
|
||||
}
|
||||
if(m_FreezeTime > 0)
|
||||
m_FreezeTime--;
|
||||
|
@ -2201,12 +2201,12 @@ void CCharacter::DDRacePostCoreTick()
|
|||
// teleport gun
|
||||
if(m_TeleGunTeleport)
|
||||
{
|
||||
GameServer()->CreateDeath(m_Pos, m_pPlayer->GetCID(), Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateDeath(m_Pos, m_pPlayer->GetCID(), TeamMask());
|
||||
m_Core.m_Pos = m_TeleGunPos;
|
||||
if(!m_IsBlueTeleGunTeleport)
|
||||
m_Core.m_Vel = vec2(0, 0);
|
||||
GameServer()->CreateDeath(m_TeleGunPos, m_pPlayer->GetCID(), Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateSound(m_TeleGunPos, SOUND_WEAPON_SPAWN, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||
GameServer()->CreateDeath(m_TeleGunPos, m_pPlayer->GetCID(), TeamMask());
|
||||
GameServer()->CreateSound(m_TeleGunPos, SOUND_WEAPON_SPAWN, TeamMask());
|
||||
m_TeleGunTeleport = false;
|
||||
m_IsBlueTeleGunTeleport = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue