Fix soldiers never showing their pain skins as long as they're alive.

Since `self->helth` is set after calling `master_start()`
`self->max_health is always 0. Found by @drakonorodny and
analyzed by @BjossiAlfreds.
This commit is contained in:
Yamagi 2021-11-05 07:12:05 +01:00
parent f6b76c2374
commit 640d01364c

View file

@ -1547,6 +1547,9 @@ SP_monster_soldier_light(edict_t *self)
return;
}
self->health = 20;
self->gib_health = -30;
SP_monster_soldier_x(self);
sound_pain_light = gi.soundindex("soldier/solpain2.wav");
@ -1556,8 +1559,6 @@ SP_monster_soldier_light(edict_t *self)
gi.soundindex("soldier/solatck2.wav");
self->s.skinnum = 0;
self->health = 20;
self->gib_health = -30;
}
/*
@ -1577,6 +1578,9 @@ SP_monster_soldier(edict_t *self)
return;
}
self->health = 30;
self->gib_health = -30;
SP_monster_soldier_x(self);
sound_pain = gi.soundindex("soldier/solpain1.wav");
@ -1584,8 +1588,6 @@ SP_monster_soldier(edict_t *self)
gi.soundindex("soldier/solatck1.wav");
self->s.skinnum = 2;
self->health = 30;
self->gib_health = -30;
}
/*
@ -1605,6 +1607,9 @@ SP_monster_soldier_ss(edict_t *self)
return;
}
self->health = 40;
self->gib_health = -30;
SP_monster_soldier_x(self);
sound_pain_ss = gi.soundindex("soldier/solpain3.wav");
@ -1612,8 +1617,6 @@ SP_monster_soldier_ss(edict_t *self)
gi.soundindex("soldier/solatck3.wav");
self->s.skinnum = 4;
self->health = 40;
self->gib_health = -30;
}
void
@ -3279,6 +3282,9 @@ SP_monster_soldier_ripper(edict_t *self)
return;
}
self->health = 50;
self->gib_health = -30;
SP_monster_soldier_h(self);
sound_pain_light = gi.soundindex("soldier/solpain2.wav");
@ -3289,8 +3295,6 @@ SP_monster_soldier_ripper(edict_t *self)
gi.soundindex("soldier/solatck2.wav");
self->s.skinnum = 0;
self->health = 50;
self->gib_health = -30;
}
/*
@ -3310,6 +3314,9 @@ SP_monster_soldier_hypergun(edict_t *self)
return;
}
self->health = 60;
self->gib_health = -30;
SP_monster_soldier_h(self);
gi.modelindex("models/objects/blaser/tris.md2");
@ -3318,8 +3325,6 @@ SP_monster_soldier_hypergun(edict_t *self)
gi.soundindex("soldier/solatck1.wav");
self->s.skinnum = 2;
self->health = 60;
self->gib_health = -30;
}
/*
@ -3339,6 +3344,9 @@ SP_monster_soldier_lasergun(edict_t *self)
return;
}
self->health = 70;
self->gib_health = -30;
SP_monster_soldier_h(self);
sound_pain_ss = gi.soundindex("soldier/solpain3.wav");
@ -3346,6 +3354,4 @@ SP_monster_soldier_lasergun(edict_t *self)
gi.soundindex("soldier/solatck3.wav");
self->s.skinnum = 4;
self->health = 70;
self->gib_health = -30;
}