Added entity fields startRGBA and endRGBA, minor bugfixes

This commit is contained in:
Walter Julius Hennecke 2011-12-05 11:07:34 +01:00
parent 12851350a9
commit 18b101c4b6
4 changed files with 16 additions and 3 deletions

View file

@ -139,7 +139,7 @@ void steam_think( gentity_t *ent )
// FIXME: This may be a bit weird for steam bursts*/
// If a fool gets in the bolt path, zap 'em
if ( ent->damage || )
if ( ent->damage )
{
vec3_t start, temp;
trace_t trace;
@ -172,12 +172,12 @@ void steam_use( gentity_t *self, gentity_t *other, gentity_t *activator )
return;
if ( self->count )
{
ent->think = 0;
self->think = 0;
self->nextthink = -1;
}
else
{
ent->think = steam_think;
self->think = steam_think;
self->nextthink = level.time + 100;
}

View file

@ -386,6 +386,8 @@ struct gentity_s {
char *luaParm4;
qboolean luaEntity;
#endif
vec4_t startRGBA;
vec4_t endRGBA;
};
/** \enum clientConnected_t

View file

@ -63,6 +63,8 @@ field_t fields[] = {
{"luaParm4", FOFS(luaParm4), F_LSTRING},
{"luaEntity", FOFS(luaEntity), F_INT},
#endif
{"startRGBA", FOFS(startRGBA), F_VECTOR4},
{"endRGBA", FOFS(endRGBA), F_VECTOR4},
{NULL}
};
@ -550,6 +552,7 @@ qboolean G_ParseField( const char *key, const char *value, gentity_t *ent ) {
byte *b;
float v;
vec3_t vec;
vec4_t vec4;
int i;
for ( f=fields ; f->name ; f++ ) {
@ -567,6 +570,13 @@ qboolean G_ParseField( const char *key, const char *value, gentity_t *ent ) {
((float *)(b+f->ofs))[1] = vec[1];
((float *)(b+f->ofs))[2] = vec[2];
break;
case F_VECTOR4:
i = sscanf (value, "%f %f %f %f", &vec4[0], &vec[1], &vec[2], &vec[3]);
((float *)(b+f->ofs))[0] = vec[0];
((float *)(b+f->ofs))[0] = vec[1];
((float *)(b+f->ofs))[0] = vec[2];
((float *)(b+f->ofs))[0] = vec[3];
break;
case F_INT:
*(int *)(b+f->ofs) = atoi(value);
break;

View file

@ -7,6 +7,7 @@ typedef enum {
F_LSTRING, // string on disk, pointer in memory, TAG_LEVEL
F_GSTRING, // string on disk, pointer in memory, TAG_GAME
F_VECTOR,
F_VECTOR4,
F_ANGLEHACK,
F_ENTITY, // index on disk, pointer in memory
F_ITEM, // index on disk, pointer in memory