summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-11-24 14:12:18 +0100
committerPaweł Redman <pawel.redman@gmail.com>2018-11-24 14:17:40 +0100
commitcc57d1bf292667944c2712333c226defe4204417 (patch)
tree53cad560f5f86d63f28287da454f550fa50510dd /src/game
parentc59bf3e4a718260158115451bfe2839d04a337cb (diff)
Notify humans whenever the RC is hit by a teammate.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_buildable.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index ce9048d..f39dbd7 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1927,6 +1927,27 @@ void HReactor_Think( gentity_t *self )
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
}
+/*
+================
+HReactor_Pain
+================
+*/
+
+void HReactor_Pain( gentity_t *self, gentity_t *attacker, int damage)
+{
+ if (self->health <= 0)
+ return;
+
+ if (!attacker || !attacker->client)
+ return;
+
+ if (attacker->client->pers.teamSelection != PTE_HUMANS)
+ return;
+
+ G_TeamCommand(PTE_HUMANS, va( "print \"Reactor ^3DAMAGED^7 by ^1TEAMMATE^7 %s^7\n\"",
+ attacker->client->pers.netname));
+}
+
//==================================================================================
@@ -3843,6 +3864,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
built->die = HSpawn_Die;
built->use = HRepeater_Use;
built->powered = built->active = qtrue;
+ built->pain = HReactor_Pain;
break;
case BA_H_REPEATER: