g_stats.c

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 #include "g_local.h"
00026 
00031 void G_SendStats (edict_t * ent)
00032 {
00033     /* extra sanity checks */
00034     assert(ent->TU >= 0);
00035     ent->HP = max(ent->HP, 0);
00036     ent->STUN = min(ent->STUN, 255);
00037     ent->morale = max(ent->morale, 0);
00038 
00039     G_EventActorStats(ent);
00040 }
00041 
00046 void G_SendPlayerStats (const player_t *player)
00047 {
00048     edict_t *ent = NULL;
00049 
00050     while ((ent = G_EdictsGetNextActor(ent)))
00051         if (ent->team == player->pers.team)
00052             G_SendStats(ent);
00053 }

Generated by  doxygen 1.6.2