I was looking at the freelook code for when a soldier is wounded and from the looks of it the code is the same from rtcw… I dont know what causes this to not work though in et… anyone able to fix this? and might be able to point me in the right direction to get this fixed
freelook bug
I didn’t really get your question - you want to have freelook? that’s already possible in etpro (or was that an SD-patch? haven’t played normal ET since first ETpro is released), you might want to ask bani at his forum
yup… want to fix the freelook bug that etmain currently has where you cant move at all … etpro fixed it… but I was just wondering if anyone else has
I could be wrong but I think you should look at this function…
// DHM - Nerve
void WolfFindMedic( gentity_t *self ) {
int i, medic=-1;
gclient_t *cl;
vec3_t start, end, temp;
trace_t tr;
float bestdist=1024, dist;
self->client->ps.viewlocked_entNum = 0;
self->client->ps.viewlocked = 0;
self->client->ps.stats[STAT_DEAD_YAW] = 999;
VectorCopy( self->s.pos.trBase, start );
start[2] += self->client->ps.viewheight;
for( i = 0; i < level.numConnectedClients; i++ ) {
cl = &level.clients[ level.sortedClients[i] ];
if( level.sortedClients[i] == self->client->ps.clientNum ) {
continue;
}
if( cl->sess.sessionTeam != self->client->sess.sessionTeam ) {
continue;
}
if( cl->ps.pm_type == PM_DEAD ) {
continue;
}
if( cl->ps.stats[ STAT_HEALTH ] <= 0 ) {
continue;
}
if( cl->ps.stats[ STAT_PLAYER_CLASS ] != PC_MEDIC ) {
continue;
}
VectorCopy( g_entities[level.sortedClients[i]].s.pos.trBase, end );
end[2] += cl->ps.viewheight;
trap_Trace (&tr, start, NULL, NULL, end, self->s.number, CONTENTS_SOLID);
if( tr.fraction < 0.95 ) {
continue;
}
VectorSubtract( end, start, end );
dist = VectorNormalize( end );
if ( dist < bestdist ) {
medic = cl->ps.clientNum;
vectoangles( end, temp );
self->client->ps.stats[STAT_DEAD_YAW] = temp[YAW];
bestdist = dist;
}
}
if ( medic >= 0 ) {
self->client->ps.viewlocked_entNum = medic;
self->client->ps.viewlocked = 7;
}
}
yea I looked at that one too… seems this code is the same as rtcw’s code as well
Index: et/src/cgame/cg_view.c
diff -u et/src/cgame/cg_view.c:1.1.1.1 et/src/cgame/cg_view.c:1.2
--- et/src/cgame/cg_view.c:1.1.1.1 Sat Aug 2 16:25:55 2003
+++ et/src/cgame/cg_view.c Sun Aug 3 16:15:33 2003
@@ -960,7 +960,8 @@
cg.zoomSensitivity = cg.refdef.fov_y / 500.0;
} else
*/
- if( cg.snap->ps.pm_type == PM_FREEZE || cg.snap->ps.pm_type == PM_DEAD || cg.snap->ps.pm_flags & PMF_TIME_LOCKPLAYER ) {
+ // rain - allow freelook when dead until we tap out into limbo
+ if( cg.snap->ps.pm_type == PM_FREEZE || (cg.snap->ps.pm_type == PM_DEAD && (cg.snap->ps.pm_flags & PMF_LIMBO)) || cg.snap->ps.pm_flags & PMF_TIME_LOCKPLAYER ) {
// No movement for pauses
cg.zoomSensitivity = 0;
} else if ( !cg.zoomedBinoc ) {
(n.b. the line numbers are vs. ET 2.55)
weeeee oh thank you very much… damn that itty bitty limbo check kept the whole damn thing from working … imagine that… gj rain Ive spent hours looking for the damn bug and couldnt find it to save the life of me
I still can’t get this to work. I’m just fixing bugs in the SDK, and the only thing changed in the cgame directory is this.
/cgame/cg_view.c; Line 959+
/*
if( cg.predictedPlayerState.eFlags & EF_PRONE ) {
cg.zoomSensitivity = cg.refdef.fov_y / 500.0;
} else
*/
// rain - allow freelook when dead until we tap out into limbo
if( cg.snap->ps.pm_type == PM_FREEZE || (cg.snap->ps.pm_type == PM_DEAD && (cg.snap->ps.pm_flags & PMF_LIMBO)) || cg.snap->ps.pm_flags & PMF_TIME_LOCKPLAYER ) {
// No movement for pauses
cg.zoomSensitivity = 0;
} else if ( !cg.zoomedBinoc ) {
// NERVE - SMF - fix for zoomed in/out movement bug
if ( cg.zoomval ) {
cg.zoomSensitivity = 0.6 * ( cg.zoomval / 90.f ); // NERVE - SMF - changed to get less sensitive as you zoom in
// cg.zoomSensitivity = 0.1;
} else {
cg.zoomSensitivity = 1;
}
// -NERVE - SMF
} else {
cg.zoomSensitivity = cg.refdef_current->fov_y / 75.0;
}
return inwater;
}
I finally got this to work. In addition to rains change, you also have to uncomment and change the following code in CG_OffsetThirdPersonView
// if dead, look at killer
/* if ( cg.predictedPlayerState.stats[STAT_HEALTH] <= 0 ) {
focusAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
cg.refdefViewAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
}*/
to
// CHRUKER: Fixing the freelook around. This code was commented out.
if ( !(cg.predictedPlayerState.pm_flags & PMF_LIMBO) && cg.predictedPlayerState.stats[STAT_HEALTH] <= 0 ) {
focusAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
cg.refdefViewAngles[YAW] = cg.predictedPlayerState.stats[STAT_DEAD_YAW];
}
for bani
)