diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 98c2be839..9bd40f4d7 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -336,16 +336,20 @@ void CCharacter::FireWeapon() case WEAPON_GUN: { - CProjectile *Proj = new CProjectile(GameWorld(), WEAPON_GUN, - m_pPlayer->GetCID(), - ProjStartPos, - Direction, - (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_GunLifetime), - 0, - 0, - 0, - -1, - WEAPON_GUN); + CProjectile *Proj = new CProjectile + ( + GameWorld(), + WEAPON_GUN,//Type + m_pPlayer->GetCID(),//Owner + ProjStartPos,//Pos + Direction,//Dir + (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_GunLifetime),//Span + 0,//Freeze + 0,//Explosive + 0,//Force + -1,//SoundImpact + WEAPON_GUN//Weapon + ); // pack the Projectile and send it to the client Directly CNetObj_Projectile p; @@ -399,15 +403,20 @@ void CCharacter::FireWeapon() case WEAPON_GRENADE: { - CProjectile *Proj = new CProjectile(GameWorld(), WEAPON_GRENADE, - m_pPlayer->GetCID(), - ProjStartPos, - Direction, - (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_GrenadeLifetime), - 0, - true, - 0, - SOUND_GRENADE_EXPLODE, WEAPON_GRENADE); + CProjectile *Proj = new CProjectile + ( + GameWorld(), + WEAPON_GRENADE,//Type + m_pPlayer->GetCID(),//Owner + ProjStartPos,//Pos + Direction,//Dir + (int)(Server()->TickSpeed()*GameServer()->Tuning()->m_GrenadeLifetime),//Span + 0,//Freeze + true,//Explosive + 0,//Force + SOUND_GRENADE_EXPLODE,//SoundImpact + WEAPON_GRENADE//Weapon + );//SoundImpact // pack the Projectile and send it to the client Directly CNetObj_Projectile p; diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp index 086160838..e3732f94c 100644 --- a/src/game/server/entities/projectile.cpp +++ b/src/game/server/entities/projectile.cpp @@ -99,11 +99,11 @@ void CProjectile::Tick() if(m_LifeSpan > -1) m_LifeSpan--; - if( (TargetChr && (g_Config.m_SvHit || TargetChr == OwnerChar)) || Collide) + if( (TargetChr && ((g_Config.m_SvHit || m_Owner == -1) || TargetChr == OwnerChar)) || Collide) { if(m_Explosive/*??*/ && (!TargetChr || (TargetChr && !m_Freeze))) { - GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, false); + GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, (m_Owner == -1)?true:false); GameServer()->CreateSound(ColPos, m_SoundImpact); } else if(TargetChr && m_Freeze) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 8ed955b0f..c54c217c9 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -159,7 +159,9 @@ bool IGameController::OnEntity(int Index, vec2 Pos, bool Front) if (Index - ENTITY_CRAZY_SHOTGUN_U_EX == i) { float Deg = i*(pi/2); - CProjectile *bullet = new CProjectile(&GameServer()->m_World, + CProjectile *bullet = new CProjectile + ( + &GameServer()->m_World, WEAPON_SHOTGUN, //Type -1, //Owner Pos, //Pos @@ -167,9 +169,10 @@ bool IGameController::OnEntity(int Index, vec2 Pos, bool Front) -2, //Span true, //Freeze true, //Explosive - 0, - (g_Config.m_SvShotgunBulletSound)?SOUND_GRENADE_EXPLODE:-1, - WEAPON_SHOTGUN); + 0,//Force + (g_Config.m_SvShotgunBulletSound)?SOUND_GRENADE_EXPLODE:-1,//SoundImpact + WEAPON_SHOTGUN//Weapon + ); bullet->SetBouncing(2 - (i % 2)); }