Moved more code from event.inc to appropriate modules, fixed kill bonus.

This commit is contained in:
Greyscale
2009-05-20 22:39:24 -07:00
parent bb05cbccd0
commit 8edf223dc1
3 changed files with 45 additions and 16 deletions

View File

@ -225,6 +225,38 @@ InfectOnClientSpawn(client)
}
}
/**
* Client has been killed.
*
* @param client The client index.
* @param attacker The attacker index.
*/
InfectOnClientDeath(client, attacker)
{
// If attacker isn't valid, then stop.
if (!ZRIsValidClient(attacker))
{
return;
}
// If attacker isn't a human, then stop.
if (!InfectIsClientHuman(attacker))
{
return;
}
// If client isn't a zombie, then stop.
if (!InfectIsClientInfected(client))
{
return;
}
// Add kill bonus to attacker's score.
new bonus = ClassGetKillBonus(index);
new score = ToolsClientScore(attacker, true, false);
ToolsClientScore(attacker, true, true, score + bonus);
}
/** Client has been hurt.
*
* @param client The client index.