Skip to content

Commit

Permalink
Add toggle for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf6542 committed Sep 9, 2021
1 parent 88d3a43 commit 45c25e5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,11 +1633,18 @@ void ClientThink_real( gentity_t *ent ) {
}


// use the precise origin for linking
VectorCopy( ent->client->ps.origin, ent->r.currentOrigin ); // RTCWPro - no snap origin, see above

// use the snapped origin for linking so it matches client predicted versions
//VectorCopy( ent->s.pos.trBase, ent->r.currentOrigin ); // RTCWPro - nope
// RTCWPro
if (!g_thinkSnapOrigin.integer)
{
// use the precise origin for linking
VectorCopy(ent->client->ps.origin, ent->r.currentOrigin);
}
else
{
// use the snapped origin for linking so it matches client predicted versions
VectorCopy(ent->s.pos.trBase, ent->r.currentOrigin);
}
// RTCWPro

VectorCopy( pm.mins, ent->r.mins );
VectorCopy( pm.maxs, ent->r.maxs );
Expand Down
1 change: 1 addition & 0 deletions src/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,7 @@ extern vmCvar_t g_bodiesGrabFlags;
extern vmCvar_t g_mapScriptDirectory;
extern vmCvar_t g_thinkStateLevelTime;
extern vmCvar_t g_endStateLevelTime;
extern vmCvar_t g_thinkSnapOrigin;

void trap_Printf( const char *fmt );
void trap_Error( const char *fmt );
Expand Down
2 changes: 2 additions & 0 deletions src/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ vmCvar_t g_bodiesGrabFlags;
vmCvar_t g_mapScriptDirectory;
vmCvar_t g_thinkStateLevelTime;
vmCvar_t g_endStateLevelTime;
vmCvar_t g_thinkSnapOrigin;

cvarTable_t gameCvarTable[] = {
// don't override the cheat state set by the system
Expand Down Expand Up @@ -501,6 +502,7 @@ cvarTable_t gameCvarTable[] = {
{ &g_mapScriptDirectory, "g_mapScriptDirectory", "", 0, qfalse },
{ &g_damageRadiusKnockback, "g_damageRadiusKnockback", "1000", 0, 0, qtrue },
{ &g_thinkStateLevelTime, "g_thinkStateLevelTime", "1", CVAR_ARCHIVE | CVAR_LATCH, 0, qfalse },
{ &g_thinkSnapOrigin, "g_thinkSnapOrigin", "1", CVAR_ARCHIVE | CVAR_LATCH, 0, qfalse },
{ &g_endStateLevelTime, "g_endStateLevelTime", "1", CVAR_ARCHIVE | CVAR_LATCH, 0, qfalse },
{&stats_matchid, "stats_matchid", "None", CVAR_SERVERINFO | CVAR_ROM, 0, qfalse},
{ &P, "P", "", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse } // ET Port Players server info
Expand Down

0 comments on commit 45c25e5

Please sign in to comment.