1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-13 16:16:08 +00:00

Do not collide shots with entity if shot->firer == entity.

This check was already done if entity was ET_ENEMY,
but it seems more correct to me to check this for all cases.
Hope this doesn't break anything.
This commit is contained in:
fgenesis 2013-04-22 23:41:48 +02:00
parent 0490afe7a2
commit 405045b3fb

View file

@ -1233,6 +1233,8 @@ Game::Game() : StateObject()
loadEntityTypeList();
lastCollideMaskIndex = -1;
}
@ -8356,7 +8358,7 @@ void Game::registerSporeDrop(const Vector &pos, int t)
bool Game::isEntityCollideWithShot(Entity *e, Shot *shot)
{
if (!shot->isHitEnts())
if (!shot->isHitEnts() || shot->firer == e)
{
return false;
}
@ -8366,8 +8368,6 @@ bool Game::isEntityCollideWithShot(Entity *e, Shot *shot)
return false;
}
if (e->getEntityType() == ET_ENEMY)
{
if (shot->firer != e)
{
if (shot->getDamageType() == DT_AVATAR_BITE)
{
@ -8382,11 +8382,6 @@ bool Game::isEntityCollideWithShot(Entity *e, Shot *shot)
return true;
}
}
else
{
return false;
}
}
else if (e->getEntityType() == ET_AVATAR)
{
// this used to be stuff != ET_AVATAR.. but what else would do that