Remove m_Weapon parameter from CProjectile

This commit is contained in:
fokkonaut 2019-06-02 22:04:11 +02:00
parent 055b1fea79
commit af7fd12341
4 changed files with 8 additions and 16 deletions

View file

@ -473,8 +473,7 @@ void CCharacter::FireWeapon()
0,//Freeze
0,//Explosive
0,//Force
-1,//SoundImpact
WEAPON_GUN//Weapon
-1//SoundImpact
);
// pack the Projectile and send it to the client Directly
@ -510,7 +509,7 @@ void CCharacter::FireWeapon()
ProjStartPos,
vec2(cosf(a), sinf(a))*Speed,
(int)(Server()->TickSpeed()*GameServer()->Tuning()->m_ShotgunLifetime),
1, 0, 0, -1, WEAPON_SHOTGUN);
1, 0, 0, -1);
// pack the Projectile and send it to the client Directly
CNetObj_Projectile p;
@ -552,8 +551,7 @@ void CCharacter::FireWeapon()
0,//Freeze
true,//Explosive
0,//Force
SOUND_GRENADE_EXPLODE,//SoundImpact
WEAPON_GRENADE//Weapon
SOUND_GRENADE_EXPLODE//SoundImpact
);//SoundImpact
// pack the Projectile and send it to the client Directly

View file

@ -20,7 +20,6 @@ CProjectile::CProjectile
bool Explosive,
float Force,
int SoundImpact,
int Weapon,
int Layer,
int Number
)
@ -35,7 +34,6 @@ CProjectile::CProjectile
m_Force = Force;
//m_Damage = Damage;
m_SoundImpact = SoundImpact;
m_Weapon = Weapon;
m_StartTick = Server()->Tick();
m_Explosive = Explosive;
@ -145,7 +143,7 @@ void CProjectile::Tick()
{
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);
}
else if (m_Owner >= 0 && (m_Weapon != WEAPON_GRENADE || g_Config.m_SvDestroyBulletsOnDeath))
else if (m_Owner >= 0 && (m_Type != WEAPON_GRENADE || g_Config.m_SvDestroyBulletsOnDeath))
{
GameServer()->m_World.DestroyEntity(this);
return;
@ -153,7 +151,7 @@ void CProjectile::Tick()
if( ((pTargetChr && (pOwnerChar ? !(pOwnerChar->m_Hit&CCharacter::DISABLE_HIT_GRENADE) : g_Config.m_SvHit || m_Owner == -1 || pTargetChr == pOwnerChar)) || Collide || GameLayerClipped(CurPos)) && !IsWeaponCollide)
{
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Weapon == WEAPON_SHOTGUN && Collide)))))
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Type == WEAPON_SHOTGUN && Collide)))))
{
int Number = 1;
if(GameServer()->EmulateBug(BUG_GRENADE_DOUBLEEXPLOSION) && m_LifeSpan == -1 && m_InitialLifeSpan == 0)
@ -162,7 +160,7 @@ void CProjectile::Tick()
}
for(int i = 0; i < Number; i++)
{
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, (!pTargetChr ? -1 : pTargetChr->Team()),
GameServer()->CreateExplosion(ColPos, m_Owner, m_Type, m_Owner == -1, (!pTargetChr ? -1 : pTargetChr->Team()),
(m_Owner != -1)? TeamMask : -1LL);
GameServer()->CreateSound(ColPos, m_SoundImpact,
(m_Owner != -1)? TeamMask : -1LL);
@ -235,7 +233,7 @@ void CProjectile::Tick()
m_Direction.y = 0;
m_Pos += m_Direction;
}
else if (m_Weapon == WEAPON_GUN)
else if (m_Type == WEAPON_GUN)
{
GameServer()->CreateDamageInd(CurPos, -atan2(m_Direction.x, m_Direction.y), 10, (m_Owner != -1)? TeamMask : -1LL);
GameServer()->m_World.DestroyEntity(this);
@ -263,7 +261,7 @@ void CProjectile::Tick()
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);
}
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, (!pOwnerChar ? -1 : pOwnerChar->Team()),
GameServer()->CreateExplosion(ColPos, m_Owner, m_Type, m_Owner == -1, (!pOwnerChar ? -1 : pOwnerChar->Team()),
(m_Owner != -1)? TeamMask : -1LL);
GameServer()->CreateSound(ColPos, m_SoundImpact,
(m_Owner != -1)? TeamMask : -1LL);

View file

@ -18,7 +18,6 @@ public:
bool Explosive,
float Force,
int SoundImpact,
int Weapon,
int Layer = 0,
int Number = 0
);
@ -39,7 +38,6 @@ private:
int m_Type;
//int m_Damage;
int m_SoundImpact;
int m_Weapon;
float m_Force;
int m_StartTick;
bool m_Explosive;

View file

@ -187,7 +187,6 @@ bool IGameController::OnEntity(int Index, vec2 Pos, int Layer, int Flags, int Nu
true, //Explosive
0, //Force
(g_Config.m_SvShotgunBulletSound)?SOUND_GRENADE_EXPLODE:-1,//SoundImpact
WEAPON_SHOTGUN,//Weapon
Layer,
Number
);
@ -217,7 +216,6 @@ bool IGameController::OnEntity(int Index, vec2 Pos, int Layer, int Flags, int Nu
false, //Explosive
0,
SOUND_GRENADE_EXPLODE,
WEAPON_SHOTGUN, //Weapon
Layer,
Number
);