fix cavespider poisoning even if attack is in cooldown
make attack function more responsive fix cavespider poisoning even if attack is in cooldown make attack function more responsive Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack code style fix cavespider poisoning even if attack is in cooldown make attack function more responsive fix cavespider poisoning even if attack is in cooldown make attack function more responsive Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack code style Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack Merge branch 'master' into cavespider-attack Merge branch 'master' into cavespider-attack fix cavespider poisoning even if attack is in cooldown make attack function more responsive fix cavespider poisoning even if attack is in cooldown make attack function more responsive Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack code style fix cavespider poisoning even if attack is in cooldown make attack function more responsive fix cavespider poisoning even if attack is in cooldown make attack function more responsive Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack code style Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack Merge branch 'master' into cavespider-attack Merge branch 'master' into cavespider-attack Merge branch 'cavespider-attack' of github.com:Gargaj/cuberite into cavespider-attack
This commit is contained in:
+6
-3
@@ -32,7 +32,7 @@ void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
|
||||
|
||||
void cGhast::Attack(std::chrono::milliseconds a_Dt)
|
||||
bool cGhast::Attack(std::chrono::milliseconds a_Dt)
|
||||
{
|
||||
m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
|
||||
|
||||
@@ -44,17 +44,20 @@ void cGhast::Attack(std::chrono::milliseconds a_Dt)
|
||||
cGhastFireballEntity * GhastBall = new cGhastFireballEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
|
||||
if (GhastBall == nullptr)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!GhastBall->Initialize(*m_World))
|
||||
{
|
||||
delete GhastBall;
|
||||
GhastBall = nullptr;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_World->BroadcastSpawnEntity(*GhastBall);
|
||||
m_AttackInterval = 0.0;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user