Failsafe for when no hiders_changed_sound is defined.

master
Icedream 2016-04-02 20:59:55 +02:00
parent 499b2142d2
commit 3b3dd02382
1 changed files with 6 additions and 2 deletions

View File

@ -356,12 +356,15 @@ onPlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHit
if (IsDefined(player.customModel))
{
player.customModel Delete();
if (IsDefined(game["hiders_changed_sound"]))
player PlaySound(game["hiders_changed_sound"]);
}
// If victim had a custom model set, reset it
if (IsDefined(player.originalModel))
{
player SetModel(player.originalModel);
if (IsDefined(game["hiders_changed_sound"]))
player PlaySound(game["hiders_changed_sound"]);
player.originalModel = undefined;
}
@ -798,6 +801,7 @@ enableModelChange(playerCommand) {
newhealth = healthfrac * (trace["entity"] GetNormalHealth());
player SetModel(trace["entity"].model);
if (IsDefined(game["hiders_changed_sound"]))
player PlaySound(game["hiders_changed_sound"]);
player.health = newhealth;