diff --git a/code/game/g_active.c b/code/game/g_active.c index 75c3eea..a440873 100644 --- a/code/game/g_active.c +++ b/code/game/g_active.c @@ -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 diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 6dff2d9..769e226 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -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); } /* diff --git a/code/game/g_main.c b/code/game/g_main.c index 4b54310..bb0ec5d 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -2463,7 +2463,7 @@ void G_RunFrame( int levelTime ) { // ent = &g_entities[0]; for (i=0 ; iclient == NULL || ent->inuse == qfalse ) { + if ( ent == NULL || ent->inuse == qfalse ) { continue; } diff --git a/code/game/g_usable.c b/code/game/g_usable.c index b28cdfc..0820d5c 100644 --- a/code/game/g_usable.c +++ b/code/game/g_usable.c @@ -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 ) {