From 04fa335c32eca9a86bcc4912351bb5190665420d Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Mar 2020 20:59:17 +0200 Subject: Getting this ready for testing --- src/game/g_client.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/game/g_client.c') diff --git a/src/game/g_client.c b/src/game/g_client.c index 9f6710c..9801ff9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1915,7 +1915,20 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles // 1 in 10 chance they spawn sick //if( rand( ) % 10 == 0 ) if( client->pers.classSelection != PCL_NONE ) + { + for( i = 0; i < level.maxclients; i++ ) + { + gentity_t *ent = g_entities + i; + + if( ent->client && ent->health > 0 && ent->client->covidKind > COVID_NONE + && ent->client->covidKind < COVID_RECOVERED ) + goto spawn_healthy; + } + + trap_SendServerCommand( ent - g_entities, "print \"^1COVID^7: You're patient zero.\n\"" ); G_ContractCoronavirus( ent ); + } +spawn_healthy: // health will count down towards max_health ent->health = client->ps.stats[ STAT_HEALTH ] = client->ps.stats[ STAT_MAX_HEALTH ]; //* 1.25; -- cgit