Merge pull request #67 from NeonKnightOA/turretfix

Fix: Turrets shooting faster while in melee range, which wasn't intended.
This commit is contained in:
Yamagi 2020-04-20 08:41:10 +02:00 committed by GitHub
commit 03a7d77127
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -980,7 +980,6 @@ turret_checkattack(edict_t *self)
vec3_t spot1, spot2;
float chance, nexttime;
trace_t tr;
int enemy_range;
if (!self)
{
@ -1048,20 +1047,6 @@ turret_checkattack(edict_t *self)
return false;
}
enemy_range = range(self, self->enemy);
if (enemy_range == RANGE_MELEE)
{
/* don't always melee in easy mode */
if ((skill->value == SKILL_EASY) && (rand() & 3))
{
return false;
}
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
if (self->spawnflags & SPAWN_ROCKET)
{
chance = 0.10;