Various local variable renames, re-arranging code with overly long
lines and getting rid of references to the global host_client and
sv_player pointers.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Change the spec of user command functions to always take a pointer to
the client struct of the executing client. Gets rid of *lots* of
references to the global host_client pointer.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Make the callers pass in the client id number and for now get them to
also set the global host_client and sv_player variables.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Make the playermove onground member a pointer to the physent - the
server wants to know which entity (edict) the player is standing
on. Make the onground member of the player_state_t a boolean, since
nobody cares what you're standing on, only if you are air/water bourne
or not (view.c).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
The usercmd is not modified, so just make it a const pointer
instead. Probably should be passed as a separate argument instead...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Get rid of global state and track using playermove_t. Software NQ gets
a little fix by reading the onground state from the view_message
(player_state_t) rather than the global onground value.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Only used by QWSV, so exclude it from the client completely and rename
it to something more indicative of its purpose.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This change of rounding method seems to have caused some 'sticky'
movement across surfaces in certain orientations. Don't understand why
as yet, but revert for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
There is still a reference to the global physent stack hidden in
Cam_DoTrace, but at least we can get rid of all references to pmove.
Renamed some local variables for better clarity and replaced the
re-implementation of vector length vlen() with Length() from mathlib.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Eliminates direct references to the global pestack from pmove.c. As a
bonus, all passed in references are const.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
The information about physents is kind of separate from the rest of
the player move information - it is also set up before doing
movement/prediction and should be read-only during those calculations.
Most places now get a pointer to the "pestack" (kind of a stack due to
adding player entities to the top and popping them off again) passed
in rather than referring to the global data directly.
Still kind of a mess, but should be able to clean up further from
here.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
To quick to put in the VectorMA where it doesn't belong.
Still, this makes me curious why the nudge is necessary so often...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
On each invocation of CL_SetSolidEntities, the previous state gets
overwritten, so only the last call matters. So it should be safe to
lift out from CL_ParseServerMessage, then out of the loop in
CL_ReadPackets and finally up into Host_Frame in cl_main.c.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Slightly modified the behaviour of this function. Previously it would
always round to the nearest 1/8th coordinate towards zero, whereas now
I round to the nearest coordinate. Also, there would previously always
be at least one nudge, but I test the position once before starting
that process.
Hopefully, haven't broken any weird behaviour that depends on
this. Got to be careful when dealing with the physics of Quake!
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Now cl_cam.c does not refer to the global pmove, and Cam_Track is the
single point of entry. Now to see what other dependencies might be
hiding around the palce - maybe it can be localised further...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>