Another update, fix typo

This commit is contained in:
trml 2020-05-03 00:00:27 +02:00
parent cda99668c7
commit f6c44468de
3 changed files with 9 additions and 20 deletions

View file

@ -70,7 +70,7 @@ void CCharacter::HandleJetpack()
return;
// check for ammo
if(!m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo)
if(!m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo || m_FreezeTime)
{
return;
}
@ -286,7 +286,7 @@ void CCharacter::FireWeapon()
return;
// check for ammo
if(!m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo)
if(!m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo || m_FreezeTime)
{
return;
}
@ -905,11 +905,6 @@ bool CCharacter::Freeze(int Seconds)
return false;
if (m_FreezeTick < GameWorld()->GameTick() - GameWorld()->GameTickSpeed() || Seconds == -1)
{
for(int i = 0; i < NUM_WEAPONS; i++)
if(m_aWeapons[i].m_Got)
{
m_aWeapons[i].m_Ammo = 0;
}
m_FreezeTime = Seconds == -1 ? Seconds : Seconds * GameWorld()->GameTickSpeed();
m_FreezeTick = GameWorld()->GameTick();
return true;
@ -926,8 +921,6 @@ bool CCharacter::UnFreeze()
{
if (m_FreezeTime > 0)
{
for(int i=0;i<NUM_WEAPONS;i++)
m_aWeapons[i].m_Ammo = -1;
if(!m_aWeapons[m_Core.m_ActiveWeapon].m_Got)
m_Core.m_ActiveWeapon = WEAPON_GUN;
m_FreezeTime = 0;
@ -956,8 +949,7 @@ void CCharacter::GiveWeapon(int Weapon, bool Remove)
}
else
{
if(!m_FreezeTime)
m_aWeapons[Weapon].m_Ammo = -1;
m_aWeapons[Weapon].m_Ammo = -1;
}
m_aWeapons[Weapon].m_Got = !Remove;

View file

@ -34,12 +34,9 @@ void CPickup::Tick()
{
if(pChr->GetWeaponGot(i))
{
if(!(pChr->m_FreezeTime && i == WEAPON_NINJA))
{
pChr->SetWeaponGot(i, false);
pChr->SetWeaponAmmo(i, 0);
sound = true;
}
pChr->SetWeaponGot(i, false);
pChr->SetWeaponAmmo(i, 0);
sound = true;
}
}
pChr->SetNinjaActivationDir(vec2(0,0));
@ -47,12 +44,12 @@ void CPickup::Tick()
pChr->SetNinjaCurrentMoveTime(0);
if (sound)
pChr->SetLastWeapon(WEAPON_GUN);
if(!pChr->m_FreezeTime && pChr->GetActiveWeapon() >= WEAPON_SHOTGUN)
if(pChr->GetActiveWeapon() >= WEAPON_SHOTGUN)
pChr->SetActiveWeapon(WEAPON_HAMMER);
break;
case POWERUP_WEAPON:
if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || (pChr->GetWeaponAmmo(m_Subtype) != -1 && !pChr->m_FreezeTime)))
if(m_Subtype >= 0 && m_Subtype < NUM_WEAPONS && (!pChr->GetWeaponGot(m_Subtype) || pChr->GetWeaponAmmo(m_Subtype) != -1))
pChr->GiveWeapon(m_Subtype);
break;

View file

@ -168,7 +168,7 @@ CProjectile::CProjectile(CGameWorld *pGameWorld, int ID, CNetObj_Projectile *pPr
m_Bouncing = m_Freeze = 0;
m_Explosive = (pProj->m_Type == WEAPON_GRENADE) && (fabs(1.0f - length(m_Direction)) < 0.015f);
}
m_Type = m_Type = pProj->m_Type;
m_Type = pProj->m_Type;
m_StartTick = pProj->m_StartTick;
m_TuneZone = GameWorld()->m_WorldConfig.m_PredictTiles ? Collision()->IsTune(Collision()->GetMapIndex(m_Pos)) : 0;