Skip to content

Commit 474aad1

Browse files
committed
Fix bug with medics reanimating skeletons
1 parent 5468ca6 commit 474aad1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/combat/abilities/playermonster/playertomedic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ void p_medic_reanimate (edict_t *ent, edict_t *target)
4949
skill_level = floattoint((1.0+MEDIC_RESURRECT_BONUS)*ent->myskills.abilities[MEDIC].current_level);
5050

5151
if (!strcmp(target->classname, "drone")
52-
&& (ent->num_monsters + target->monsterinfo.control_cost <= MAX_MONSTERS))
52+
&& (ent->num_monsters + target->monsterinfo.control_cost <= MAX_MONSTERS)
53+
&& !(target->flags & FL_UNDEAD) && target->mtype != M_DECOY) // don't revive decoys and undead (skeletons)
5354
{
5455
target->monsterinfo.level = skill_level;
5556
M_SetBoundingBox(target->mtype, bmin, bmax);

src/entities/drone/drone_ai.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ qboolean M_ValidMedicTarget(const edict_t *self, const edict_t *target) {
369369
// is this a monster corpse?
370370
if (!strcmp(target->classname, "drone"))
371371
{
372+
if (target->mtype == M_DECOY || target->flags & FL_UNDEAD) // don't target decoys and the undead (skeletons)
373+
return false;
372374
// if we are player-owned, don't resurrect more than maximum limit
373375
if (self->activator && self->activator->client
374376
&& (self->activator->num_monsters + target->monsterinfo.control_cost > MAX_MONSTERS))

src/entities/drone/drone_medic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ void M_Reanimate (edict_t *ent, edict_t *target, int r_level, float r_modifier,
650650
vec3_t bmin, bmax;
651651
edict_t *e;
652652

653-
if (!strcmp(target->classname, "drone"))
653+
if (!strcmp(target->classname, "drone") && !(target->flags & FL_UNDEAD) && target->mtype != M_DECOY) // can't revive decoys and undead/skeletons
654654
{
655655
// if the summoner is a player, check for sufficient monster slots
656656
if (ent->client && (ent->num_monsters + target->monsterinfo.control_cost > MAX_MONSTERS))

0 commit comments

Comments
 (0)