fix FireShotgun missing normalise
This commit is contained in:
parent
e2dc1ba102
commit
f7b1ba4049
@ -108,10 +108,17 @@ CWeapon::Fire(CEntity *shooter, CVector *fireSource)
|
|||||||
CVector fireOffset(0.0f, 0.0f, 0.6f);
|
CVector fireOffset(0.0f, 0.0f, 0.6f);
|
||||||
CVector *source = fireSource;
|
CVector *source = fireSource;
|
||||||
|
|
||||||
if (!fireSource) {
|
if (!fireSource)
|
||||||
|
{
|
||||||
|
fireOffset = shooter->GetMatrix() * fireOffset;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
static CVector tmp;
|
static CVector tmp;
|
||||||
tmp = shooter->GetMatrix() * fireOffset;
|
tmp = fireOffset;
|
||||||
source = &tmp;
|
source = &tmp;
|
||||||
|
#else
|
||||||
|
source = &fireOffset;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
if ( m_bAddRotOffset )
|
if ( m_bAddRotOffset )
|
||||||
{
|
{
|
||||||
@ -1166,6 +1173,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
|
|||||||
{
|
{
|
||||||
float shootAngle = DEGTORAD(7.5f*i + shooterAngle - 15.0f);
|
float shootAngle = DEGTORAD(7.5f*i + shooterAngle - 15.0f);
|
||||||
CVector2D shootRot(-Sin(shootAngle), Cos(shootAngle));
|
CVector2D shootRot(-Sin(shootAngle), Cos(shootAngle));
|
||||||
|
shootRot.Normalise();
|
||||||
|
|
||||||
CVector source, target;
|
CVector source, target;
|
||||||
CColPoint point;
|
CColPoint point;
|
||||||
|
Loading…
Reference in New Issue
Block a user