Don't allow Teeka's shots to hurt the player.
This commit is contained in:
parent
7b915a77a8
commit
1d033cf327
|
@ -145,11 +145,10 @@ static void preFire(void)
|
|||
|
||||
attack();
|
||||
|
||||
u->shotsToFire--;
|
||||
|
||||
if (u->shotsToFire == 0)
|
||||
if (--u->shotsToFire <= 0)
|
||||
{
|
||||
u->thinkTime = FPS;
|
||||
u->action = lookForEnemies;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ static void tick(void)
|
|||
static void touch(Entity *other)
|
||||
{
|
||||
Bullet *b;
|
||||
int canHit;
|
||||
|
||||
b = (Bullet*)self;
|
||||
|
||||
|
@ -95,7 +96,20 @@ static void touch(Entity *other)
|
|||
playBattleSound(SND_RICO_2, b->uniqueId % MAX_SND_CHANNELS, b->x, b->y);
|
||||
}
|
||||
}
|
||||
else if (other != b->owner && (!(other->flags & EF_IGNORE_BULLETS)) && b->owner->type != other->type)
|
||||
else
|
||||
{
|
||||
canHit = (
|
||||
other != b->owner &&
|
||||
(!(other->flags & EF_IGNORE_BULLETS)) &&
|
||||
b->owner->type != other->type
|
||||
);
|
||||
|
||||
if (b->owner->type == ET_TEEKA && other->type == ET_BOB)
|
||||
{
|
||||
canHit = 0;
|
||||
}
|
||||
|
||||
if (canHit)
|
||||
{
|
||||
swapSelf(other);
|
||||
other->applyDamage(b->damage);
|
||||
|
@ -123,3 +137,4 @@ static void touch(Entity *other)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,9 +269,7 @@ static void preFire(void)
|
|||
|
||||
u->attack();
|
||||
|
||||
u->shotsToFire--;
|
||||
|
||||
if (u->shotsToFire == 0)
|
||||
if (--u->shotsToFire == 0)
|
||||
{
|
||||
u->action = u->walk;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue