I'm tweeking pmove.c for the luls.

fixed 8859-1 for non-english hexen2
tweeking my deltaing.
cl_demospeed bugs fixed.
fixed things being seen through skys.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3990 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-02-14 15:50:34 +00:00
parent 61061c8e71
commit ee72d0ca0d
29 changed files with 481 additions and 326 deletions

View file

@ -502,11 +502,16 @@ void CLFTE_ReadDelta(unsigned int entnum, entity_state_t *news, entity_state_t *
Con_Printf("%3i: Update %4i 0x%x\n", msg_readcount, entnum, bits);
if (bits & UF_RESET)
{
// Con_Printf("%3i: Reset %i @ %i\n", msg_readcount, entnum, cls.netchan.incoming_sequence);
*news = *baseline;
}
else if (!olds)
{
Con_DPrintf("New entity without reset\n");
*news = *baseline;
/*reset got lost, probably the data will be filled in later - FIXME: we should probably ignore this entity*/
// Con_DPrintf("New entity without reset\n");
memset(news, 0, sizeof(*news));
// *news = *baseline;
}
else
*news = *olds;
@ -600,12 +605,15 @@ void CLFTE_ReadDelta(unsigned int entnum, entity_state_t *news, entity_state_t *
news->u.q1.msec = MSG_ReadByte();
else
news->u.q1.msec = 0;
if (predbits & UFP_WEAPONFRAME)
{
news->u.q1.weaponframe = MSG_ReadByte();
if (news->u.q1.weaponframe & 0x80)
news->u.q1.weaponframe = (news->u.q1.weaponframe & 127) | (MSG_ReadByte()<<7);
}
}
else
{
news->u.q1.pmovetype = 0;
news->u.q1.msec = 0;
}
if (bits & UF_MODEL)
{
@ -667,18 +675,12 @@ void CLFTE_ReadDelta(unsigned int entnum, entity_state_t *news, entity_state_t *
if (bits & UF_FATNESS)
news->fatness = MSG_ReadByte();
/*update the prediction info if needed*/
if ((bits & UF_PREDINFO) && (news->number-1) < cl.allocated_client_slots)
{
frame_t *fram;
fram = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
CL_PlayerFrameUpdated(&fram->playerstate[news->number-1], news, cls.netchan.incoming_sequence);
}
}
/*
Note: strictly speaking, you don't need multiple frames, just two and flip between them.
FTE retains the full 64 frames because its interpolation will go multiple packets back in time to cover packet loss.
*/
void CLFTE_ParseEntities(void)
{
int oldpacket, newpacket;
@ -686,6 +688,7 @@ void CLFTE_ParseEntities(void)
unsigned short newnum, oldnum;
int oldindex;
qboolean isvalid = false;
entity_state_t *e;
// int i;
// for (i = cl.validsequence+1; i < cls.netchan.incoming_sequence; i++)
@ -700,7 +703,7 @@ void CLFTE_ParseEntities(void)
cl.frames[newpacket].invalid = true;
if (cls.netchan.incoming_sequence >= cl.validsequence + UPDATE_BACKUP)
if (!cl.validsequence || cls.netchan.incoming_sequence-cl.validsequence >= UPDATE_BACKUP-1)
{
oldp = &nullp;
oldp->num_entities = 0;
@ -738,6 +741,7 @@ void CLFTE_ParseEntities(void)
}
if (newnum == 0x8000)
{
/*removal of world - means forget all entities*/
if (cl_shownet.ival >= 3)
Con_Printf("%3i: Reset all\n", msg_readcount);
newp->num_entities = 0;
@ -763,7 +767,7 @@ void CLFTE_ParseEntities(void)
if (newnum & 0x8000)
{
if (cl_shownet.ival >= 3)
Con_Printf("%3i: Remove %i\n", msg_readcount, (newnum&32767));
Con_Printf("%3i: Remove %i @ %i\n", msg_readcount, (newnum&32767), cls.netchan.incoming_sequence);
if (oldnum == (newnum&0x7fff))
oldindex++;
continue;
@ -786,6 +790,21 @@ void CLFTE_ParseEntities(void)
}
}
for (oldindex = 0; oldindex < newp->num_entities; oldindex++)
{
e = newp->entities + oldindex;
if (e->number > cl.allocated_client_slots)
break;
/*update the prediction info if needed*/
if (e->u.q1.pmovetype)
{
frame_t *fram;
fram = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
CL_PlayerFrameUpdated(&fram->playerstate[e->number-1], e, cls.netchan.incoming_sequence);
}
}
if (isvalid)
{
cl.oldvalidsequence = cl.validsequence;
@ -794,7 +813,10 @@ void CLFTE_ParseEntities(void)
cl.frames[newpacket].invalid = false;
}
else
{
newp->num_entities = 0;
cl.validsequence = 0;
}
/*ackedinputsequence is updated when we have new player prediction info*/
cl.ackedinputsequence = cls.netchan.incoming_sequence;
@ -3170,6 +3192,17 @@ void CL_ParsePlayerinfo (void)
TP_ParsePlayerInfo(oldstate, state, info);
cl.players[num].stats[STAT_WEAPONFRAME] = state->weaponframe;
cl.players[num].statsf[STAT_WEAPONFRAME] = state->weaponframe;
for (i = 0; i < cl.splitclients; i++)
{
if (cl.playernum[i] == num)
{
cl.stats[i][STAT_WEAPONFRAME] = state->weaponframe;
cl.statsf[i][STAT_WEAPONFRAME] = state->weaponframe;
}
}
if (cl.splitclients < MAX_SPLITS)
{
extern cvar_t cl_splitscreen;
@ -3382,6 +3415,15 @@ guess_pm_type:
TP_ParsePlayerInfo(oldstate, state, info);
for (i = 0; i < cl.splitclients; i++)
{
if (cl.playernum[i] == num)
{
cl.stats[i][STAT_WEAPONFRAME] = state->weaponframe;
cl.statsf[i][STAT_WEAPONFRAME] = state->weaponframe;
}
}
if (cl.worldmodel && cl_lerp_players.ival)
{
player_state_t exact;
@ -3938,7 +3980,7 @@ void CL_SetSolidEntities (void)
if (!state->solid && !state->skinnum)
continue;
if (state->solid == 31)
if (state->solid == ES_SOLID_BSP)
{ /*bsp model size*/
if (state->modelindex <= 0)
continue;
@ -4129,6 +4171,7 @@ void CL_SetSolidPlayers (void)
memset(pent, 0, sizeof(physent_t));
VectorCopy(pplayer->origin, pent->origin);
pent->info = j+1;
VectorCopy(player_mins, pent->mins);
VectorCopy(player_maxs, pent->maxs);
if (++pmove.numphysent == MAX_PHYSENTS) //we just hit 88 miles per hour.

View file

@ -520,7 +520,7 @@ void CL_AdjustAngles (int pnum, double frametime)
quant *= speed;
in_rotate -= quant;
if (ruleset_allow_frj.ival)
cl.viewangles[pnum][YAW] += quant;
cl.viewanglechange[pnum][YAW] += quant;
}
if (!(in_strafe.state[pnum] & 1))
@ -528,9 +528,8 @@ void CL_AdjustAngles (int pnum, double frametime)
quant = cl_yawspeed.ival;
if (cl.fpd & FPD_LIMIT_YAW || !ruleset_allow_frj.ival)
quant = bound(-900, quant, 900);
cl.viewangles[pnum][YAW] -= speed*quant * CL_KeyState (&in_right, pnum);
cl.viewangles[pnum][YAW] += speed*quant * CL_KeyState (&in_left, pnum);
cl.viewangles[pnum][YAW] = anglemod(cl.viewangles[pnum][YAW]);
cl.viewanglechange[pnum][YAW] -= speed*quant * CL_KeyState (&in_right, pnum);
cl.viewanglechange[pnum][YAW] += speed*quant * CL_KeyState (&in_left, pnum);
}
if (in_klook.state[pnum] & 1)
{
@ -538,8 +537,8 @@ void CL_AdjustAngles (int pnum, double frametime)
quant = cl_pitchspeed.ival;
if (cl.fpd & FPD_LIMIT_PITCH || !ruleset_allow_frj.ival)
quant = bound(-700, quant, 700);
cl.viewangles[pnum][PITCH] -= speed*quant * CL_KeyState (&in_forward, pnum);
cl.viewangles[pnum][PITCH] += speed*quant * CL_KeyState (&in_back, pnum);
cl.viewanglechange[pnum][PITCH] -= speed*quant * CL_KeyState (&in_forward, pnum);
cl.viewanglechange[pnum][PITCH] += speed*quant * CL_KeyState (&in_back, pnum);
}
up = CL_KeyState (&in_lookup, pnum);
@ -548,19 +547,11 @@ void CL_AdjustAngles (int pnum, double frametime)
quant = cl_pitchspeed.ival;
if (!ruleset_allow_frj.ival)
quant = bound(-700, quant, 700);
cl.viewangles[pnum][PITCH] -= speed*cl_pitchspeed.ival * up;
cl.viewangles[pnum][PITCH] += speed*cl_pitchspeed.ival * down;
cl.viewanglechange[pnum][PITCH] -= speed*cl_pitchspeed.ival * up;
cl.viewanglechange[pnum][PITCH] += speed*cl_pitchspeed.ival * down;
if (up || down)
V_StopPitchDrift (pnum);
CL_ClampPitch(pnum);
if (cl.viewangles[pnum][ROLL] > 50)
cl.viewangles[pnum][ROLL] = 50;
if (cl.viewangles[pnum][ROLL] < -50)
cl.viewangles[pnum][ROLL] = -50;
V_StopPitchDrift (pnum);
}
/*
@ -612,10 +603,60 @@ int MakeChar (int i)
void CL_ClampPitch (int pnum)
{
vec3_t view[4];
vec3_t impact, norm;
float mat[16], mat2[16];
static float oldtime;
float timestep = realtime - oldtime;
oldtime = realtime;
if (1)
{
AngleVectors(cl.viewangles[pnum], view[0], view[1], view[2]);
Matrix4x4_RM_FromVectors(mat, view[0], view[1], view[2], vec3_origin);
Matrix4_Multiply(Matrix4x4_CM_NewRotation(-cl.viewanglechange[pnum][PITCH], 0, 1, 0), mat, mat2);
Matrix4_Multiply(Matrix4x4_CM_NewRotation(cl.viewanglechange[pnum][YAW], 0, 0, 1), mat2, mat);
Matrix3x4_RM_ToVectors(mat, view[0], view[1], view[2], view[3]);
VectorMA(cl.simorg[pnum], -48, view[2], view[3]);
if (!TraceLineN(cl.simorg[pnum], view[3], impact, norm))
{
norm[0] = 0;
norm[1] = 0;
norm[2] = 1;
}
{
vec3_t cross;
float roll;
float dot;
/*keep the roll relative to the 'ground'*/
CrossProduct(norm, view[2], cross);
dot = DotProduct(view[0], cross);
roll = timestep * 720/M_PI * -(dot);
Con_Printf("%f %f\n", dot, roll);
Matrix4_Multiply(Matrix4x4_CM_NewRotation(roll, 1, 0, 0), mat, mat2);
Matrix3x4_RM_ToVectors(mat2, view[0], view[1], view[2], view[3]);
}
VectorAngles(view[0], view[2], cl.viewangles[pnum]);
cl.viewangles[pnum][PITCH]=360 - cl.viewangles[pnum][PITCH];
VectorClear(cl.viewanglechange[pnum]);
return;
}
cl.viewangles[pnum][PITCH] += cl.viewanglechange[pnum][PITCH];
cl.viewangles[pnum][YAW] += cl.viewanglechange[pnum][YAW];
cl.viewangles[pnum][ROLL] += cl.viewanglechange[pnum][ROLL];
VectorClear(cl.viewanglechange[pnum]);
#ifdef Q2CLIENT
float pitch;
if (cls.protocol == CP_QUAKE2)
{
float pitch;
pitch = SHORT2ANGLE(cl.q2frame.playerstate.pmove.delta_angles[PITCH]);
if (pitch > 180)
pitch -= 360;
@ -647,6 +688,11 @@ void CL_ClampPitch (int pnum)
if (cl.viewangles[pnum][PITCH] < cl.minpitch)
cl.viewangles[pnum][PITCH] = cl.minpitch;
}
if (cl.viewangles[pnum][ROLL] > 50)
cl.viewangles[pnum][ROLL] = 50;
if (cl.viewangles[pnum][ROLL] < -50)
cl.viewangles[pnum][ROLL] = -50;
}
/*
@ -659,6 +705,8 @@ void CL_FinishMove (usercmd_t *cmd, int msecs, int pnum)
int i;
int bits;
CL_ClampPitch(pnum);
//
// always dump the first two message, because it may contain leftover inputs
// from the last level
@ -1375,6 +1423,7 @@ void CL_SendCmd (double frametime, qboolean mainloop)
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
{
extern cvar_t cl_splitscreen;
cl.ackedinputsequence = cls.netchan.outgoing_sequence;
i = cls.netchan.outgoing_sequence & UPDATE_MASK;
cl.frames[i].senttime = realtime; // we haven't gotten a reply yet
// cl.frames[i].receivedtime = -1; // we haven't gotten a reply yet

View file

@ -2781,7 +2781,7 @@ void CL_ReadPackets (void)
// check timeout
//
if (cls.state >= ca_connected
&& realtime - cls.netchan.last_received > cl_timeout.value)
&& realtime - cls.netchan.last_received > cl_timeout.value && !cls.demoplayback)
{
#ifndef CLIENTONLY
/*don't timeout when we're the actual server*/

View file

@ -24,8 +24,6 @@ cvar_t cl_nopred = SCVAR("cl_nopred","0");
extern cvar_t cl_lerp_players;
cvar_t cl_pushlatency = SCVAR("pushlatency","-999");
extern frame_t *view_frame;
extern float pm_airaccelerate;
extern usercmd_t independantphysics[MAX_SPLITS];
@ -768,7 +766,7 @@ static void CL_DecodeStateSize(unsigned short solid, int modelindex, vec3_t mins
void CL_PlayerFrameUpdated(player_state_t *plstate, entity_state_t *state, int sequence)
{
/*update the prediction info*/
int pmtype;
int pmtype, i;
if (state->u.q1.pmovetype == MOVETYPE_NOCLIP)
{
if (cls.z_ext & Z_EXT_PM_TYPE_NEW)
@ -790,6 +788,17 @@ void CL_PlayerFrameUpdated(player_state_t *plstate, entity_state_t *state, int s
VectorScale(state->u.q1.velocity, 1/8.0, plstate->velocity);
plstate->messagenum = sequence;
cl.players[state->number-1].stats[STAT_WEAPONFRAME] = state->u.q1.weaponframe;
cl.players[state->number-1].statsf[STAT_WEAPONFRAME] = state->u.q1.weaponframe;
for (i = 0; i < cl.splitclients; i++)
{
if (cl.playernum[i] == state->number-1)
{
cl.stats[i][STAT_WEAPONFRAME] = state->u.q1.weaponframe;
cl.statsf[i][STAT_WEAPONFRAME] = state->u.q1.weaponframe;
}
}
CL_DecodeStateSize(state->solid, state->modelindex, plstate->szmins, plstate->szmaxs);
}
@ -891,7 +900,6 @@ void CL_PredictMovePNum (int pnum)
{
return;
}
CL_ClampPitch(pnum);
if (cls.netchan.outgoing_sequence - cl.ackedinputsequence >= UPDATE_BACKUP-1)
{ //lagging like poo.
if (!cl.intermission) //keep the angles working though.
@ -977,7 +985,7 @@ fixedorg:
goto fixedorg;
}
to = &cl.frames[cl.ackedinputsequence & UPDATE_MASK];
to = &cl.frames[cl.validsequence & UPDATE_MASK];
from = &cl.frames[cl.oldvalidsequence & UPDATE_MASK];
//figure out the lerp factor
@ -1030,8 +1038,6 @@ fixedorg:
CL_PredictUsercmd (pnum, &from->playerstate[cl.playernum[pnum]]
, &to->playerstate[cl.playernum[pnum]], &to->cmd[pnum]);
cl.onground[pnum] = pmove.onground;
if (to->senttime >= realtime)
break;
from = to;
@ -1046,9 +1052,8 @@ fixedorg:
to->senttime = realtime;
CL_PredictUsercmd (pnum, &from->playerstate[cl.playernum[pnum]]
, &to->playerstate[cl.playernum[pnum]], &to->cmd[pnum]);
cl.onground[pnum] = pmove.onground;
}
cl.onground[pnum] = pmove.onground;
stepheight = to->playerstate[cl.playernum[pnum]].origin[2] - from->playerstate[cl.playernum[pnum]].origin[2];
if (cl.nolocalplayer[pnum])

View file

@ -538,6 +538,7 @@ typedef struct
// sent to the server each frame. And only reset at level change
// and teleport times
vec3_t viewangles[MAX_SPLITS];
vec3_t viewanglechange[MAX_SPLITS];
// the client simulates or interpolates movement to get these values
double time; // this is the time value that the client

View file

@ -901,10 +901,10 @@ void Con_DrawInput (int left, int right, int y)
rhs = x + left;
if (cursorframe)
{
extern cvar_t com_parseutf8;
if (com_parseutf8.ival)
Font_DrawChar(rhs, y, (*cursor&~(CON_BGMASK|CON_FGMASK)) | (COLOR_BLUE<<CON_BGSHIFT) | CON_NONCLEARBG | CON_WHITEMASK);
else
// extern cvar_t com_parseutf8;
// if (com_parseutf8.ival)
// Font_DrawChar(rhs, y, (*cursor&~(CON_BGMASK|CON_FGMASK)) | (COLOR_BLUE<<CON_BGSHIFT) | CON_NONCLEARBG | CON_WHITEMASK);
// else
Font_DrawChar(rhs, y, 0xe000|11|CON_WHITEMASK);
}
else if (*cursor)

View file

@ -83,7 +83,7 @@ void IN_Move (float *movements, int pnum)
}
else
{
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum])
@ -91,8 +91,7 @@ void IN_Move (float *movements, int pnum)
if (in_mlook.state[pnum] && !(in_strafe.state[pnum] & 1))
{
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
cl.viewangles[pnum][PITCH] = bound(-70, cl.viewangles[pnum][PITCH], 80);
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
}
else
{

View file

@ -281,14 +281,13 @@ void IN_Move (float *movements, int pnum)
}
else
{
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum] & 1)
V_StopPitchDrift (pnum);
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1)) {
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
CL_ClampPitch(pnum);
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
} else {
if (movements)
{

View file

@ -315,16 +315,14 @@ void IN_Move (float *movements, int pnum) //add mouse movement to cmd
if ( (in_strafe.state[pnum] & 1) || (lookstrafe.value && (in_mlook.state[pnum] & 1) ))
movements[1] += m_side.value * mouse_x;
else
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
if (in_mlook.state[pnum] & 1)
V_StopPitchDrift (pnum);
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1))
{
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
CL_ClampPitch(pnum);
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
}
else
{

View file

@ -1389,7 +1389,7 @@ static void ProcessMouse(mouse_t *mouse, float *movements, int pnum)
{
// if ((int)((cl.viewangles[pnum][PITCH]+89.99)/180) & 1)
// mouse_x *= -1;
cl.viewangles[pnum][YAW] -= m_yaw.value * mouse_x;
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum] & 1)
@ -1397,9 +1397,7 @@ static void ProcessMouse(mouse_t *mouse, float *movements, int pnum)
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1))
{
cl.viewangles[pnum][PITCH] += m_pitch.value * mouse_y;
CL_ClampPitch(pnum);
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
}
else
{
@ -2152,11 +2150,11 @@ void IN_JoyMove (float *movements, int pnum)
// only absolute control support here (joy_advanced is false)
if (m_pitch.value < 0.0)
{
cl.viewangles[pnum][PITCH] -= (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
cl.viewanglechange[pnum][PITCH] -= (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
}
else
{
cl.viewangles[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
cl.viewanglechange[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
}
V_StopPitchDrift(pnum);
}
@ -2203,11 +2201,11 @@ void IN_JoyMove (float *movements, int pnum)
{
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
{
cl.viewangles[pnum][YAW] += (fAxisValue * joy_yawsensitivity.value) * aspeed * cl_yawspeed.value;
cl.viewanglechange[pnum][YAW] += (fAxisValue * joy_yawsensitivity.value) * aspeed * cl_yawspeed.value;
}
else
{
cl.viewangles[pnum][YAW] += (fAxisValue * joy_yawsensitivity.value) * speed * 180.0;
cl.viewanglechange[pnum][YAW] += (fAxisValue * joy_yawsensitivity.value) * speed * 180.0;
}
}
@ -2222,11 +2220,11 @@ void IN_JoyMove (float *movements, int pnum)
// pitch movement detected and pitch movement desired by user
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
{
cl.viewangles[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
cl.viewanglechange[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
}
else
{
cl.viewangles[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * speed * 180.0;
cl.viewanglechange[pnum][PITCH] += (fAxisValue * joy_pitchsensitivity.value) * speed * 180.0;
}
V_StopPitchDrift(pnum);
}

View file

@ -558,7 +558,7 @@ void Key_Console (unsigned int unicode, int key)
if (key_lines[edit_line][key_linepos])
{
int charlen = 1;
if (com_parseutf8.ival &&
if (com_parseutf8.ival>0 &&
(key_lines[edit_line][key_linepos] & 0xc0) != 0x80)
{
while((key_lines[edit_line][key_linepos+charlen] & 0xc0) == 0x80)
@ -577,7 +577,7 @@ void Key_Console (unsigned int unicode, int key)
if (key_linepos > 1)
{
int charlen = 1;
if (com_parseutf8.ival)
if (com_parseutf8.ival>0)
{
while (key_linepos > charlen && (key_lines[edit_line][key_linepos-charlen] & 0xc0) == 0x80)
charlen++;
@ -730,10 +730,10 @@ void Key_Console (unsigned int unicode, int key)
unsigned char c2;
unsigned char c3;
if (unicode > 127)
if (unicode > ((com_parseutf8.ival<0)?255:127))
{
extern cvar_t com_parseutf8;
if (com_parseutf8.ival)
if (com_parseutf8.ival>0)
{
if (unicode > 0xffff)
{

View file

@ -1113,9 +1113,6 @@ static void QCBUILTIN PF_cs_unproject (progfuncs_t *prinst, struct globalvars_s
//clear scene, and set up the default stuff.
static void QCBUILTIN PF_R_ClearScene (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
extern frame_t *view_frame;
extern player_state_t *view_message;
if (*prinst->callargc > 0)
CSQC_ChangeLocalPlayer(G_FLOAT(OFS_PARM0));
@ -1133,12 +1130,6 @@ static void QCBUILTIN PF_R_ClearScene (progfuncs_t *prinst, struct globalvars_s
skel_dodelete(csqcprogs);
CL_SwapEntityLists();
view_frame = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
view_message = &view_frame->playerstate[cl.playernum[csqc_lplayernum]];
#ifdef NQPROT
if (cls.protocol == CP_NETQUAKE || !view_message->messagenum)
view_message->weaponframe = cl.stats[csqc_lplayernum][STAT_WEAPONFRAME];
#endif
V_CalcRefdef(csqc_lplayernum); //set up the defaults (for player 0)
csqc_addcrosshair = false;
@ -4682,9 +4673,11 @@ void CSQC_World_GetFrameState(world_t *w, wedict_t *win, framestate_t *out)
void CSQC_Shutdown(void)
{
search_close_progs(csqcprogs, false);
if (csqcprogs)
{
search_close_progs(csqcprogs, false);
PR_fclose_progs(csqcprogs);
CSQC_ForgetThreads();
CloseProgs(csqcprogs);
}

View file

@ -101,7 +101,6 @@ extern cvar_t cl_chasecam;
float v_dmg_time[MAX_SPLITS], v_dmg_roll[MAX_SPLITS], v_dmg_pitch[MAX_SPLITS];
frame_t *view_frame;
player_state_t *view_message;
/*
@ -1111,14 +1110,14 @@ void V_CalcRefdef (int pnum)
else if (scr_viewsize.value == 80)
view->origin[2] += 0.5;
if (!view_message || view_message->flags & (PF_GIB|PF_DEAD) || (unsigned int)cl.stats[pnum][STAT_WEAPON] >= MAX_MODELS)
if (cl.stats[pnum][STAT_HEALTH] > 0 && (unsigned int)cl.stats[pnum][STAT_WEAPON] >= MAX_MODELS)
view->model = NULL;
else
view->model = cl.model_precache[cl.stats[pnum][STAT_WEAPON]];
#ifdef HLCLIENT
if (!CLHL_AnimateViewEntity(view))
#endif
view->framestate.g[FS_REG].frame[0] = view_message?view_message->weaponframe:0;
view->framestate.g[FS_REG].frame[0] = cl.stats[pnum][STAT_WEAPONFRAME];
// set up the refresh position
if (v_gunkick.value)
@ -1309,12 +1308,7 @@ void V_RenderPlayerViews(int plnum)
int viewnum;
#endif
SCR_VRectForPlayer(&r_refdef.vrect, plnum);
view_message = &view_frame->playerstate[cl.playernum[plnum]];
#ifdef NQPROT
if (cls.protocol == CP_NETQUAKE)
view_message->weaponframe = cl.stats[0][STAT_WEAPONFRAME];
#endif
cl.simangles[plnum][ROLL] = 0; // FIXME @@@
// cl.simangles[plnum][ROLL] = 0; // FIXME @@@
DropPunchAngle (plnum);
@ -1485,8 +1479,6 @@ void V_RenderView (void)
RSpeedEnd(RSPEED_LINKENTITIES);
}
view_frame = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
R_PushDlights ();
r_secondaryview = 0;