From a4f26c2e4a2b38113a6d57e018d37c59dc0b2199 Mon Sep 17 00:00:00 2001 From: Oscar Linderholm Date: Thu, 9 Oct 2025 18:32:13 +0200 Subject: [PATCH] Add //ktx discharge event Clients can use the event to help visualize a discharge. --- src/weapons.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/weapons.c b/src/weapons.c index 287cc28b..c57fc8f7 100644 --- a/src/weapons.c +++ b/src/weapons.c @@ -1165,6 +1165,19 @@ void LightningDamage(vec3_t p1, vec3_t p2, gedict_t *from, float damage) } } +static void DischargeEvent(int radius, vec3_t orig) +{ + gedict_t *p; + + for (p = world; (p = find_client(p));) + { + if (p->isBot) + continue; + + stuffcmd(p, "//ktx discharge %d %f %f %f\n", radius, orig[0], orig[1], orig[2]); + } +} + void W_FireLightning(void) { vec3_t org; @@ -1217,6 +1230,7 @@ void W_FireLightning(void) } T_RadiusDamage(self, self, 35 * cells, world, dtLG_DIS); + DischargeEvent((35 * cells) + 40, self->s.v.origin); return; } @@ -1234,6 +1248,7 @@ void W_FireLightning(void) } T_RadiusDamage(self, self, 35 * cells, world, dtLG_DIS); + DischargeEvent((35 * cells) + 40, self->s.v.origin); return; }