00001 00006 /* 00007 Copyright (C) 2002-2010 UFO: Alien Invasion. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00017 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 00024 */ 00025 00026 #include "../client.h" 00027 #include "cl_actor.h" 00028 #include "../cl_team.h" 00029 #include "../cl_game.h" 00030 00037 qboolean CL_AddUGV (le_t * le, entity_t * ent) 00038 { 00039 entity_t add; 00040 00041 if (!LE_IsDead(le)) { 00042 /* add weapon */ 00043 if (le->left != NONE) { 00044 memset(&add, 0, sizeof(add)); 00045 00046 add.model = cls.modelPool[le->left]; 00047 00048 add.tagent = R_GetFreeEntity() + 2 + (le->right != NONE); 00049 add.tagname = "tag_lweapon"; 00050 00051 R_AddEntity(&add); 00052 } 00053 00054 /* add weapon */ 00055 if (le->right != NONE) { 00056 memset(&add, 0, sizeof(add)); 00057 00058 add.alpha = le->alpha; 00059 add.model = cls.modelPool[le->right]; 00060 00061 add.tagent = R_GetFreeEntity() + 2; 00062 add.tagname = "tag_rweapon"; 00063 00064 R_AddEntity(&add); 00065 } 00066 } 00067 00068 /* add head */ 00069 memset(&add, 0, sizeof(add)); 00070 00071 add.alpha = le->alpha; 00072 add.model = le->model2; 00073 add.skinnum = le->skinnum; 00074 00076 add.tagent = R_GetFreeEntity() + 1; 00077 add.tagname = "tag_head"; 00078 00079 R_AddEntity(&add); 00080 00081 /* add actor special effects */ 00082 ent->flags |= RF_SHADOW; 00083 ent->flags |= RF_ACTOR; 00084 00085 if (!LE_IsDead(le)) { 00086 if (le->selected) 00087 ent->flags |= RF_SELECTED; 00088 if (le->team == cls.team) { 00089 if (le->pnum == cl.pnum) 00090 ent->flags |= RF_MEMBER; 00091 if (le->pnum != cl.pnum) 00092 ent->flags |= RF_ALLIED; 00093 } 00094 } 00095 00096 return qtrue; 00097 } 00098