summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/bg_misc.c4
-rw-r--r--src/game/g_buildable.c27
2 files changed, 28 insertions, 3 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 0992a6bf..1b25d3ed 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1428,8 +1428,8 @@ buildableAttributes_t bg_buildableList[ ] =
"medistat", //char *buildName;
"team_human_medistat", //char *entityName;
{ "models/buildables/medistat/medistat.md3", 0, 0, 0 },
- { -40, -40, -4 }, //vec3_t mins;
- { 40, 40, 4 }, //vec3_t maxs;
+ { -35, -35, -7 }, //vec3_t mins;
+ { 35, 35, 7 }, //vec3_t maxs;
TR_GRAVITY, //trType_t traj;
0.0, //float bounce;
100, //int buildPoints;
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index d0dd170d..c3c74621 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -910,6 +910,7 @@ void HDCC_Think( gentity_t *self )
+#define MAX_HEAL_CLIENTS 1
/*
================
@@ -924,6 +925,7 @@ void HMedistat_Think( gentity_t *self )
vec3_t mins, maxs;
int i, num;
gentity_t *player;
+ int healCount = 0;
VectorAdd( self->s.origin, self->r.maxs, maxs );
VectorAdd( self->s.origin, self->r.mins, mins );
@@ -934,6 +936,10 @@ void HMedistat_Think( gentity_t *self )
//make sure we have power
self->powered = findPower( self );
+ //if active use the healing idle
+ if( self->active )
+ G_setIdleBuildableAnim( self, BANIM_IDLE2 );
+
//do some healage
num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
for( i = 0; i < num; i++ )
@@ -942,11 +948,30 @@ void HMedistat_Think( gentity_t *self )
if( player->client && player->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
- if( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] )
+ if( player->health < player->client->ps.stats[ STAT_MAX_HEALTH ] && healCount < MAX_HEAL_CLIENTS )
+ {
+ healCount++;
player->health++;
+
+ //start the heal anim
+ if( !self->active )
+ {
+ G_setBuildableAnim( self, BANIM_ATTACK1, qfalse );
+ self->active = qtrue;
+ }
+ }
}
}
+ //nothing left to heal so go back to idling
+ if( healCount == 0 && self->active )
+ {
+ G_setBuildableAnim( self, BANIM_CONSTRUCT2, qtrue );
+ G_setIdleBuildableAnim( self, BANIM_IDLE1 );
+
+ self->active = qfalse;
+ }
+
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
}