forked from M-itch/libcod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gsc_entity.cpp
44 lines (32 loc) · 844 Bytes
/
gsc_entity.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "gsc_entity.hpp"
#if COMPILE_ENTITY == 1
void gsc_entity_setalive(scr_entref_t id)
{
int isAlive;
if ( ! stackGetParams("i", &isAlive))
{
stackError("gsc_entity_setalive() argument is undefined or has a wrong type");
stackPushUndefined();
return;
}
gentity_t *entity = &g_entities[id];
entity->takedamage = isAlive;
stackPushBool(qtrue);
}
void gsc_entity_setbounds(scr_entref_t id)
{
float width, height;
if ( ! stackGetParams("ff", &width, &height))
{
stackError("gsc_entity_setbounds() one or more arguments is undefined or has a wrong type");
stackPushUndefined();
return;
}
gentity_t *entity = &g_entities[id];
vec3_t mins = {-height, -width, -width};
vec3_t maxs = {width, width, height};
VectorCopy(mins, entity->r.mins);
VectorCopy(maxs, entity->r.maxs);
stackPushBool(qtrue);
}
#endif