1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-13 19:56:54 +00:00

Fix (harmless?) division by zero, show gamespeed in console

This commit is contained in:
fgenesis 2013-07-20 22:49:28 +02:00
parent c2506d5bb2
commit 06e0be0856
2 changed files with 2 additions and 2 deletions

View file

@ -4530,7 +4530,7 @@ void DSQ::onUpdate(float dt)
{
Avatar *avatar = dsq->game->avatar;
os << "rolling: " << dsq->game->avatar->isRolling() << " rollDelay: " << dsq->game->avatar->rollDelay << std::endl;
os << "canChangeForm: " << dsq->game->avatar->canChangeForm << std::endl;
os << "canChangeForm: " << dsq->game->avatar->canChangeForm << " gamespeed: " << gameSpeed.x << std::endl;
os << "h: " << dsq->game->avatar->health << " / " << dsq->game->avatar->maxHealth << std::endl;
os << "biteTimer: " << dsq->game->avatar->biteTimer << " flourTimer: " << dsq->game->avatar->flourishTimer.getValue() << std::endl;
os << "stillTimer: " << dsq->game->avatar->stillTimer.getValue() << std::endl;

View file

@ -2293,7 +2293,7 @@ Vector Game::getWallNormal(Vector pos, int sampleArea, float *dist, int obs)
avg += vs[i];
}
}
if (avg != 0)
if (c)
{
avg /= c;
if (avg.x != 0 || avg.y != 0)