Some urgent bug fixes

This commit is contained in:
Walter Julius Hennecke 2013-07-22 23:56:44 +02:00
parent 97f3cb7eba
commit c5a3beb3a8
4 changed files with 11 additions and 10 deletions

View File

@ -26,7 +26,7 @@ static void TryUse( gentity_t* ent )
vec3_t src, dest, vf;
clientSession_t* sess;
if(ent == NULL || ent->client == NULL) {
if(ent == NULL) {
return;
}
@ -54,7 +54,7 @@ static void TryUse( gentity_t* ent )
target = &g_entities[trace.entityNum];
//Check for a use command
if ( (target != NULL) && (target->use != NULL) && (ent->type == ENT_FUNC_USABLE) )
if ( (target != NULL) && (target->use != NULL) && (target->type == ENT_FUNC_USABLE) )
{//usable brush
if ( target->team && atoi( target->team ) != 0 )
{//usable has a team

View File

@ -6234,7 +6234,7 @@ static void Cmd_getEntInfo_f(gentity_t *ent) {
if(i > MAX_GENTITIES - 1)
return;
G_PrintfClient(ent, "Classname: %s\n Targetname: %s\n Target: %s\n Spawnflags: %i\n Bmodel: %s\n\"", g_entities[i].classname, g_entities[i].targetname, g_entities[i].target, g_entities[i].spawnflags, g_entities[i].model);
G_PrintfClient(ent, "EntType: %d\n Classname: %s\n Targetname: %s\n Target: %s\n Spawnflags: %i\n Bmodel: %s\n", g_entities[i].type, g_entities[i].classname, g_entities[i].targetname, g_entities[i].target, g_entities[i].spawnflags, g_entities[i].model);
}
/*

View File

@ -2463,7 +2463,7 @@ void G_RunFrame( int levelTime ) {
//
ent = &g_entities[0];
for (i=0 ; i<level.num_entities ; i++, ent++) {
if ( ent == NULL || ent->client == NULL || ent->inuse == qfalse ) {
if ( ent == NULL || ent->inuse == qfalse ) {
continue;
}

View File

@ -60,7 +60,7 @@ void func_usable_think( gentity_t *self )
{
/*self->r.svFlags |= SVF_PLAYER_USABLE;*/ /* Replace the usable flag */
self->use = func_usable_use;
self->think = 0; /*NULL*/
self->think = NULL; /*NULL*/
self->nextthink = -1;
}
}
@ -98,15 +98,16 @@ void func_usable_use (gentity_t *self, gentity_t *other, gentity_t *activator)
/* Remove the ability to use the entity directly */
/*self->r.svFlags &= ~SVF_PLAYER_USABLE;*/
/*also remove ability to call any use func at all!*/
self->use = 0; /*NULL*/
self->use = NULL; /*NULL*/
if(self->target && self->target[0])
{
if(self->spawnflags & 512)
if(self->spawnflags & 512) {
G_UseTargets(self, self);
else
} else {
G_UseTargets(self, activator);
}
}
}
if ( self->wait )
{