Merge pull request #468 from BjossiAlfreds/dodge

Fix monsters being disoriented after ducking
This commit is contained in:
Yamagi 2019-09-27 11:08:50 +02:00 committed by GitHub
commit a0d2604030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 0 deletions

View file

@ -383,6 +383,7 @@ brain_dodge(edict_t *self, edict_t *attacker, float eta)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
self->monsterinfo.pausetime = level.time + eta + 0.5; self->monsterinfo.pausetime = level.time + eta + 0.5;

View file

@ -618,6 +618,7 @@ chick_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
self->monsterinfo.currentmove = &chick_move_duck; self->monsterinfo.currentmove = &chick_move_duck;

View file

@ -609,6 +609,7 @@ gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
self->monsterinfo.currentmove = &gunner_move_duck; self->monsterinfo.currentmove = &gunner_move_duck;

View file

@ -637,6 +637,7 @@ infantry_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
self->monsterinfo.currentmove = &infantry_move_duck; self->monsterinfo.currentmove = &infantry_move_duck;

View file

@ -681,6 +681,11 @@ mmove_t medic_move_duck =
void void
medic_dodge(edict_t *self, edict_t *attacker, float eta) medic_dodge(edict_t *self, edict_t *attacker, float eta)
{ {
if (!self || !attacker)
{
return;
}
if (random() > 0.25) if (random() > 0.25)
{ {
return; return;
@ -689,6 +694,7 @@ medic_dodge(edict_t *self, edict_t *attacker, float eta)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
self->monsterinfo.currentmove = &medic_move_duck; self->monsterinfo.currentmove = &medic_move_duck;

View file

@ -1092,6 +1092,7 @@ soldier_dodge(edict_t *self, edict_t *attacker, float eta)
if (!self->enemy) if (!self->enemy)
{ {
self->enemy = attacker; self->enemy = attacker;
FoundTarget(self);
} }
if (skill->value == 0) if (skill->value == 0)