fixed problem with ninja movement while the powerup ends. #1152

This commit is contained in:
oy 2014-02-27 21:44:00 +01:00
parent 6f4d437397
commit c1778a5452

View file

@ -125,6 +125,10 @@ void CCharacter::HandleNinja()
m_aWeapons[WEAPON_NINJA].m_Got = false; m_aWeapons[WEAPON_NINJA].m_Got = false;
m_ActiveWeapon = m_LastWeapon; m_ActiveWeapon = m_LastWeapon;
// reset velocity
if(m_Ninja.m_CurrentMoveTime > 0)
m_Core.m_Vel = m_Ninja.m_ActivationDir*m_Ninja.m_OldVelAmount;
SetWeapon(m_ActiveWeapon); SetWeapon(m_ActiveWeapon);
return; return;
} }
@ -490,6 +494,7 @@ bool CCharacter::GiveWeapon(int Weapon, int Ammo)
void CCharacter::GiveNinja() void CCharacter::GiveNinja()
{ {
m_Ninja.m_ActivationTick = Server()->Tick(); m_Ninja.m_ActivationTick = Server()->Tick();
m_Ninja.m_CurrentMoveTime = -1;
m_aWeapons[WEAPON_NINJA].m_Got = true; m_aWeapons[WEAPON_NINJA].m_Got = true;
m_aWeapons[WEAPON_NINJA].m_Ammo = -1; m_aWeapons[WEAPON_NINJA].m_Ammo = -1;
if (m_ActiveWeapon != WEAPON_NINJA) if (m_ActiveWeapon != WEAPON_NINJA)