UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
cl_ugv.cpp
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24
*/
25
26
#include "
../client.h
"
27
#include "
cl_actor.h
"
28
35
bool
CL_AddUGV
(
le_t
* le,
entity_t
* ent)
36
{
37
entity_t
add(
RF_NONE
);
38
39
if
(!
LE_IsDead
(le)) {
40
/* add weapon */
41
if
(le->
left
!=
NONE
) {
42
OBJZERO
(add);
43
44
add.
model
=
cls
.modelPool[le->
left
];
45
46
add.
tagent
=
R_GetFreeEntity
() + 2 + (le->
right
!=
NONE
);
47
add.
tagname
=
"tag_lweapon"
;
48
49
R_AddEntity
(&add);
50
}
51
52
/* add weapon */
53
if
(le->
right
!=
NONE
) {
54
OBJZERO
(add);
55
56
add.
alpha
= le->
alpha
;
57
add.
model
=
cls
.modelPool[le->
right
];
58
59
add.
tagent
=
R_GetFreeEntity
() + 2;
60
add.
tagname
=
"tag_rweapon"
;
61
62
R_AddEntity
(&add);
63
}
64
}
65
66
/* add head */
67
OBJZERO
(add);
68
69
add.
alpha
= le->
alpha
;
70
add.
model
= le->
model2
;
71
add.
skinnum
= le->
bodySkin
;
72
74
add.
tagent
=
R_GetFreeEntity
() + 1;
75
add.
tagname
=
"tag_head"
;
76
77
R_AddEntity
(&add);
78
79
/* add actor special effects */
80
ent->
flags
|=
RF_SHADOW
;
81
ent->
flags
|=
RF_ACTOR
;
82
83
if
(!
LE_IsDead
(le)) {
84
if
(
LE_IsSelected
(le))
85
ent->
flags
|=
RF_SELECTED
;
86
if
(le->
team
==
cls
.team) {
87
if
(le->
pnum
==
cl
.pnum)
88
ent->
flags
|=
RF_MEMBER
;
89
if
(le->
pnum
!=
cl
.pnum)
90
ent->
flags
|=
RF_ALLIED
;
91
}
92
if
(le->
team
==
TEAM_CIVILIAN
)
93
ent->
flags
|=
RF_NEUTRAL
;
94
}
95
96
return
true
;
97
}
cl_actor.h
cl
clientBattleScape_t cl
Definition
cl_battlescape.cpp:29
LE_IsDead
#define LE_IsDead(le)
Definition
cl_localentity.h:257
LE_IsSelected
#define LE_IsSelected(le)
Definition
cl_localentity.h:266
cls
client_static_t cls
Definition
cl_main.cpp:83
CL_AddUGV
bool CL_AddUGV(le_t *le, entity_t *ent)
Adds an UGV to the render entities.
Definition
cl_ugv.cpp:35
client.h
Primary header for client.
NONE
#define NONE
Definition
defines.h:68
TEAM_CIVILIAN
#define TEAM_CIVILIAN
Definition
q_shared.h:61
R_AddEntity
int R_AddEntity(const entity_t *ent)
Adds a copy of the specified entity to the list of all known render entities.
Definition
r_entity.cpp:706
R_GetFreeEntity
entity_t * R_GetFreeEntity(void)
Get the next free entry in the entity list (the last one).
Definition
r_entity.cpp:684
RF_SHADOW
#define RF_SHADOW
Definition
r_entity.h:50
RF_ACTOR
#define RF_ACTOR
Definition
r_entity.h:46
RF_MEMBER
#define RF_MEMBER
Definition
r_entity.h:44
RF_SELECTED
#define RF_SELECTED
Definition
r_entity.h:43
RF_ALLIED
#define RF_ALLIED
Definition
r_entity.h:45
RF_NONE
#define RF_NONE
Definition
r_entity.h:34
RF_NEUTRAL
#define RF_NEUTRAL
Definition
r_entity.h:49
OBJZERO
#define OBJZERO(obj)
Definition
shared.h:178
entity_t
Definition
r_entity.h:96
entity_t::alpha
float alpha
Definition
r_entity.h:111
entity_t::flags
int flags
Definition
r_entity.h:112
entity_t::model
struct model_s * model
Definition
r_entity.h:97
entity_t::tagname
const char * tagname
Definition
r_entity.h:107
entity_t::skinnum
int skinnum
Definition
r_entity.h:110
entity_t::tagent
struct entity_s * tagent
Definition
r_entity.h:106
le_t
a local entity
Definition
cl_localentity.h:65
le_t::left
int left
Definition
cl_localentity.h:156
le_t::pnum
int pnum
Definition
cl_localentity.h:88
le_t::alpha
float alpha
Definition
cl_localentity.h:85
le_t::right
int right
Definition
cl_localentity.h:156
le_t::team
int team
Definition
cl_localentity.h:87
le_t::model2
model_t * model2
Definition
cl_localentity.h:116
le_t::bodySkin
unsigned int bodySkin
Definition
cl_localentity.h:114
src
client
battlescape
cl_ugv.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0