see description ...

* Fixed repair function for func_breakables
* Added possibility to visualize traces (add flag 2 to value of
g_developer)
* Removed debug message for func_breakables
This commit is contained in:
Walter Julius Hennecke 2012-11-11 00:36:17 +01:00
parent 8f3626b625
commit bf37df807b
5 changed files with 23 additions and 12 deletions

View file

@ -1838,6 +1838,10 @@ case EV_SHAKE_SOUND:
CG_Borg_Bolt_static( cent );
break;
case EV_DEBUG_TRACE:
FX_AddLine(cent->currentState.origin, cent->currentState.origin2, 0.5, 0.5, 0.5, 1.0, 1.0, 1000, cgs.media.laserShader);
break;
// Default
default:

View file

@ -798,6 +798,8 @@ typedef enum {
EV_STASIS_DOOR_OPENING,
EV_STASIS_DOOR_CLOSING,
EV_DEBUG_TRACE
} entity_event_t;
//RPG-X: J2J - Moved animation enum list so that the string list can see it, Note special case for cg_players.c.

View file

@ -1841,10 +1841,6 @@ void G_Repair(gentity_t *ent, gentity_t *tr_ent, float rate) {
}
}
DEVELOPER(
G_Printf("G_Repair: target=%d, goodDist=%f, curDist=%f\n", tr_ent-g_entities, 80+max, distance);
);
if(distance > 80 + max) {
return;
}

View file

@ -132,6 +132,12 @@ void trap_SetBrushModel( gentity_t *ent, const char *name ) {
void trap_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask ) {
syscall( G_TRACE, results, start, mins, maxs, end, passEntityNum, contentmask );
if(g_developer.integer & 2) { // Debug trace
vec3_t s;
VectorCopy(start, s);
gentity_t* tmp = G_TempEntity(s, EV_DEBUG_TRACE);
VectorCopy(end, tmp->s.origin2);
}
}
int trap_PointContents( const vec3_t point, int passEntityNum ) {
@ -140,11 +146,11 @@ int trap_PointContents( const vec3_t point, int passEntityNum ) {
qboolean trap_InPVS( const vec3_t p1, const vec3_t p2 ) {
return syscall( G_IN_PVS, p1, p2 );
return (qboolean)syscall( G_IN_PVS, p1, p2 );
}
qboolean trap_InPVSIgnorePortals( const vec3_t p1, const vec3_t p2 ) {
return syscall( G_IN_PVS_IGNORE_PORTALS, p1, p2 );
return (qboolean)syscall( G_IN_PVS_IGNORE_PORTALS, p1, p2 );
}
void trap_AdjustAreaPortalState( gentity_t *ent, qboolean open ) {
@ -152,7 +158,7 @@ void trap_AdjustAreaPortalState( gentity_t *ent, qboolean open ) {
}
qboolean trap_AreasConnected( int area1, int area2 ) {
return syscall( G_AREAS_CONNECTED, area1, area2 );
return (qboolean)syscall( G_AREAS_CONNECTED, area1, area2 );
}
void trap_LinkEntity( gentity_t *ent ) {
@ -169,7 +175,7 @@ int trap_EntitiesInBox( const vec3_t mins, const vec3_t maxs, int *list, int max
}
qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity_t *ent ) {
return syscall( G_ENTITY_CONTACT, mins, maxs, ent );
return (qboolean)syscall( G_ENTITY_CONTACT, mins, maxs, ent );
}
int trap_BotAllocateClient( void ) {
@ -185,7 +191,7 @@ void trap_GetUsercmd( int clientNum, usercmd_t *cmd ) {
}
qboolean trap_GetEntityToken( char *buffer, int bufferSize ) {
return syscall( G_GET_ENTITY_TOKEN, buffer, bufferSize );
return (qboolean)syscall( G_GET_ENTITY_TOKEN, buffer, bufferSize );
}
int trap_DebugPolygonCreate(int color, int numPoints, vec3_t *points) {

View file

@ -114,7 +114,8 @@ static void WP_FireHyperspanner(gentity_t *ent, qboolean alt_fire) {
gentity_t *validEnts[MAX_GENTITIES];
int count = 0;
int i, nearest = -1, nearestd = 512;
vec3_t dVec;
vec3_t dVec, end;
vec3_t mins = { -40, -40, -40 }, maxs = { 40, 40, 40 };
/* find all vlaid entities in range */
count = G_RadiusListOfType("func_breakable", ent->s.origin, 512, NULL, validEnts);
@ -122,9 +123,11 @@ static void WP_FireHyperspanner(gentity_t *ent, qboolean alt_fire) {
if(count) {
trace_t tr;
for(i = 0; i < count; i++) {
VectorSubtract(ent->r.currentOrigin, validEnts[i]->s.origin, dVec);
VectorMA(validEnts[i]->s.origin, 1024, dVec, end);
//G_Printf("Checking entity: %d\n", i);
trap_Trace(&tr, ent->s.origin, NULL, NULL, validEnts[i]->s.origin, ent->s.number, MASK_SHOT);
if(tr.entityNum != validEnts[i]->s.number && tr.entityNum != ENTITYNUM_WORLD) {
trap_Trace(&tr, validEnts[i]->s.origin, mins, maxs, end, validEnts[i]->s.number, MASK_SHOT);
if(tr.entityNum != ent->s.number) {
continue;
}
//G_Printf("Nothing is blocking view ...\n");