Apply 4253 update

This commit is contained in:
mittorn
2018-10-04 13:08:48 +07:00
parent 1e7f9d00c3
commit 5c738b3402
105 changed files with 1562 additions and 1977 deletions
+1
View File
@@ -387,6 +387,7 @@ extern convar_t sv_unlagpush;
extern convar_t sv_unlagsamples;
extern convar_t rcon_password;
extern convar_t sv_instancedbaseline;
extern convar_t sv_background_freeze;
extern convar_t sv_minupdaterate;
extern convar_t sv_maxupdaterate;
extern convar_t sv_downloadurl;
+23 -21
View File
@@ -116,7 +116,7 @@ void SV_RejectConnection( netadr_t from, char *fmt, ... )
Q_vsnprintf( text, sizeof( text ), fmt, argptr );
va_end( argptr );
MsgDev( D_REPORT, "%s connection refused. Reason: %s\n", NET_AdrToString( from ), text );
Con_Reportf( "%s connection refused. Reason: %s\n", NET_AdrToString( from ), text );
Netchan_OutOfBandPrint( NS_SERVER, from, "print\n^1Server was reject the connection:^7 %s", text );
Netchan_OutOfBandPrint( NS_SERVER, from, "disconnect\n" );
}
@@ -858,7 +858,7 @@ void SV_RemoteCommand( netadr_t from, sizebuf_t *msg )
char remaining[1024];
int i;
MsgDev( D_INFO, "Rcon from %s:\n%s\n", NET_AdrToString( from ), MSG_GetData( msg ) + 4 );
Con_Printf( "Rcon from %s:\n%s\n", NET_AdrToString( from ), MSG_GetData( msg ) + 4 );
Log_Printf( "Rcon: \"%s\" from \"%s\"\n", MSG_GetData( msg ) + 4, NET_AdrToString( from ));
SV_BeginRedirect( from, RD_PACKET, outputbuf, sizeof( outputbuf ) - 16, SV_FlushRedirect );
@@ -872,7 +872,7 @@ void SV_RemoteCommand( netadr_t from, sizebuf_t *msg )
}
Cmd_ExecuteString( remaining );
}
else MsgDev( D_ERROR, "Bad rcon_password.\n" );
else Con_Printf( S_ERROR "Bad rcon_password.\n" );
SV_EndRedirect();
}
@@ -1241,10 +1241,11 @@ void SV_PutClientInServer( sv_client_t *cl )
}
}
#ifdef HACKS_RELATED_HLMODS
// enable dev-mode to prevent crash cheat-protecting from Invasion mod
if( FBitSet( ent->v.flags, FL_GODMODE|FL_NOTARGET ) && !Q_stricmp( GI->gamefolder, "invasion" ))
SV_ExecuteClientCommand( cl, "test\n" );
#endif
// refresh the userinfo and movevars
// NOTE: because movevars can be changed during the connection process
SetBits( cl->flags, FCL_RESEND_USERINFO|FCL_RESEND_MOVEVARS );
@@ -1965,7 +1966,7 @@ void SV_ExecuteClientCommand( sv_client_t *cl, char *s )
{
if( !u->func( cl ))
Con_Printf( "'%s' is not valid from the console\n", u->name );
else MsgDev( D_NOTE, "ucmd->%s()\n", u->name );
else Con_Reportf( "ucmd->%s()\n", u->name );
break;
}
}
@@ -2095,7 +2096,7 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
// user out of band message (must be handled in CL_ConnectionlessPacket)
if( len > 0 ) Netchan_OutOfBand( NS_SERVER, from, len, buf );
}
else MsgDev( D_ERROR, "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), args );
else Con_DPrintf( S_ERROR "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), args );
}
/*
@@ -2139,7 +2140,7 @@ static void SV_ParseClientMove( sv_client_t *cl, sizebuf_t *msg )
if( totalcmds < 0 || totalcmds >= CMD_MASK )
{
MsgDev( D_ERROR, "SV_ParseClientMove: %s sending too many commands %i\n", cl->name, totalcmds );
Con_Reportf( S_ERROR "SV_ParseClientMove: %s sending too many commands %i\n", cl->name, totalcmds );
SV_DropClient( cl, false );
return;
}
@@ -2162,12 +2163,16 @@ static void SV_ParseClientMove( sv_client_t *cl, sizebuf_t *msg )
if( checksum2 != checksum1 )
{
MsgDev( D_ERROR, "SV_UserMove: failed command checksum for %s (%d != %d)\n", cl->name, checksum2, checksum1 );
Con_Reportf( S_ERROR "SV_UserMove: failed command checksum for %s (%d != %d)\n", cl->name, checksum2, checksum1 );
return;
}
cl->packet_loss = packet_loss;
// freeze player for some reasons if loadgame was executed
if( GameState->loadGame )
return;
// check for pause or frozen
if( sv.paused || !CL_IsInGame() || SV_PlayerIsFrozen( player ))
{
@@ -2274,13 +2279,12 @@ void SV_ParseResourceList( sv_client_t *cl, sizebuf_t *msg )
SV_AddToResourceList( resource, &cl->resourcesneeded );
}
if( sv_allow_upload.value )
MsgDev( D_REPORT, "Verifying and uploading resources...\n" );
totalsize = COM_SizeofResourceList( &cl->resourcesneeded, &ri );
if( totalsize != 0 && sv_allow_upload.value )
{
Con_DPrintf( "Verifying and uploading resources...\n" );
if( totalsize != 0 )
{
Con_DPrintf( "Custom resources total %.2fK\n", totalsize / 1024.0 );
@@ -2314,7 +2318,7 @@ void SV_ParseResourceList( sv_client_t *cl, sizebuf_t *msg )
SV_ClearResourceList( &cl->resourcesonhand );
return;
}
MsgDev( D_REPORT, "resources to request: %s\n", Q_memprint( totalsize ));
Con_DPrintf( "resources to request: %s\n", Q_memprint( totalsize ));
}
cl->upstate = us_processing;
@@ -2334,7 +2338,7 @@ void SV_ParseCvarValue( sv_client_t *cl, sizebuf_t *msg )
if( svgame.dllFuncs2.pfnCvarValue != NULL )
svgame.dllFuncs2.pfnCvarValue( cl->edict, value );
MsgDev( D_REPORT, "Cvar query response: name:%s, value:%s\n", cl->name, value );
Con_Reportf( "Cvar query response: name:%s, value:%s\n", cl->name, value );
}
/*
@@ -2354,7 +2358,7 @@ void SV_ParseCvarValue2( sv_client_t *cl, sizebuf_t *msg )
if( svgame.dllFuncs2.pfnCvarValue2 != NULL )
svgame.dllFuncs2.pfnCvarValue2( cl->edict, requestID, name, value );
MsgDev( D_REPORT, "Cvar query response: name:%s, request ID %d, cvar:%s, value:%s\n", cl->name, requestID, name, value );
Con_Reportf( "Cvar query response: name:%s, request ID %d, cvar:%s, value:%s\n", cl->name, requestID, name, value );
}
/*
@@ -2368,7 +2372,6 @@ void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg )
{
qboolean move_issued = false;
client_frame_t *frame;
char *s;
int c;
ASSERT( cl->frames != NULL );
@@ -2394,7 +2397,7 @@ void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg )
{
if( MSG_CheckOverflow( msg ))
{
MsgDev( D_ERROR, "SV_ReadClientMessage: clc_bad\n" );
Con_DPrintf( S_ERROR "incoming overflow for %s\n", cl->name );
SV_DropClient( cl, false );
return;
}
@@ -2418,10 +2421,9 @@ void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg )
SV_ParseClientMove( cl, msg );
break;
case clc_stringcmd:
s = MSG_ReadString( msg );
// malicious users may try using too many string commands
SV_ExecuteClientCommand( cl, s );
if( cl->state == cs_zombie ) return; // disconnect command
SV_ExecuteClientCommand( cl, MSG_ReadString( msg ));
if( cl->state == cs_zombie )
return; // disconnect command
break;
case clc_resourcelist:
SV_ParseResourceList( cl, msg );
@@ -2436,7 +2438,7 @@ void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg )
SV_ParseCvarValue2( cl, msg );
break;
default:
MsgDev( D_ERROR, "clc_bad\n" );
Con_DPrintf( S_ERROR "%s: clc_bad\n", cl->name );
SV_DropClient( cl, false );
return;
}
+2 -1
View File
@@ -248,7 +248,8 @@ void SV_MapBackground_f( void )
if( SV_Active() && !sv.background )
{
MsgDev( D_ERROR, "can't set background map while game is active\n" );
if( GameState->nextstate == STATE_RUNFRAME )
Con_Printf( S_ERROR "can't set background map while game is active\n" );
return;
}
+3 -3
View File
@@ -313,7 +313,7 @@ void SV_MoveToOnHandList( sv_client_t *cl, resource_t *pResource )
{
if( !pResource )
{
MsgDev( D_REPORT, "Null resource passed to SV_MoveToOnHandList\n" );
Con_Reportf( "Null resource passed to SV_MoveToOnHandList\n" );
return;
}
@@ -325,7 +325,7 @@ void SV_AddToResourceList( resource_t *pResource, resource_t *pList )
{
if( pResource->pPrev != NULL || pResource->pNext != NULL )
{
MsgDev( D_ERROR, "Resource already linked\n" );
Con_Reportf( S_ERROR "Resource already linked\n" );
return;
}
@@ -524,7 +524,7 @@ void SV_BatchUploadRequest( sv_client_t *cl )
}
else
{
MsgDev( D_ERROR, "Non customization in upload queue!\n" );
Con_Reportf( S_ERROR "Non customization in upload queue!\n" );
SV_MoveToOnHandList( cl, p );
}
}
+13 -7
View File
@@ -138,7 +138,7 @@ static void SV_AddEntitiesToPacket( edict_t *pViewEnt, edict_t *pClient, client_
}
// if we are full, silently discard entities
if( ents->num_entities < MAX_VISIBLE_PACKET )
if( ents->num_entities < ( MAX_VISIBLE_PACKET - 1 ))
{
ents->num_entities++; // entity accepted
c_fullsend++; // debug counter
@@ -729,7 +729,7 @@ void SV_SendClientDatagram( sv_client_t *cl )
{
if( MSG_GetNumBytesWritten( &cl->datagram ) < MSG_GetNumBytesLeft( &msg ))
MSG_WriteBits( &msg, MSG_GetData( &cl->datagram ), MSG_GetNumBitsWritten( &cl->datagram ));
else MsgDev( D_WARN, "Ignoring unreliable datagram for %s, would overflow on msg\n", cl->name );
else Con_DPrintf( S_WARN "Ignoring unreliable datagram for %s, would overflow on msg\n", cl->name );
}
MSG_Clear( &cl->datagram );
@@ -791,14 +791,14 @@ void SV_UpdateToReliableMessages( void )
// clear the server datagram if it overflowed.
if( MSG_CheckOverflow( &sv.datagram ))
{
MsgDev( D_ERROR, "sv.datagram overflowed!\n" );
Con_DPrintf( S_ERROR "sv.datagram overflowed!\n" );
MSG_Clear( &sv.datagram );
}
// clear the server datagram if it overflowed.
if( MSG_CheckOverflow( &sv.spec_datagram ))
{
MsgDev( D_ERROR, "sv.spec_datagram overflowed!\n" );
Con_DPrintf( S_ERROR "sv.spec_datagram overflowed!\n" );
MSG_Clear( &sv.spec_datagram );
}
@@ -823,7 +823,7 @@ void SV_UpdateToReliableMessages( void )
}
else
{
MsgDev( D_WARN, "Ignoring unreliable datagram for %s, would overflow\n", cl->name );
Con_DPrintf( S_WARN "Ignoring unreliable datagram for %s, would overflow\n", cl->name );
}
if( FBitSet( cl->flags, FCL_HLTV_PROXY ))
@@ -834,7 +834,7 @@ void SV_UpdateToReliableMessages( void )
}
else
{
MsgDev( D_WARN, "Ignoring spectator datagram for %s, would overflow\n", cl->name );
Con_DPrintf( S_WARN "Ignoring spectator datagram for %s, would overflow\n", cl->name );
}
}
}
@@ -889,7 +889,7 @@ void SV_SendClientMessages( void )
MSG_Clear( &cl->netchan.message );
MSG_Clear( &cl->datagram );
SV_BroadcastPrintf( NULL, "%s overflowed\n", cl->name );
MsgDev( D_WARN, "reliable overflow for %s\n", cl->name );
Con_DPrintf( S_ERROR "reliable overflow for %s\n", cl->name );
SV_DropClient( cl, false );
SetBits( cl->flags, FCL_SEND_NET_MESSAGE );
cl->netchan.cleartime = 0.0; // don't choke this message
@@ -1006,6 +1006,12 @@ void SV_InactivateClients( void )
COM_ClearCustomizationList( &cl->customdata, false );
memset( cl->physinfo, 0, MAX_PHYSINFO_STRING );
// NOTE: many mods sending messages that must be applied on a next level
// e.g. CryOfFear sending HideHud and PlayMp3 that affected after map change
if( svgame.globals->changelevel )
continue;
MSG_Clear( &cl->netchan.message );
MSG_Clear( &cl->datagram );
}
+17 -10
View File
@@ -1194,24 +1194,29 @@ pfnSetModel
*/
void pfnSetModel( edict_t *e, const char *m )
{
char name[MAX_QPATH];
model_t *mod;
int i;
if( !SV_IsValidEdict( e ))
return;
if( COM_CheckString( m ))
if( *m == '\\' || *m == '/' ) m++;
Q_strncpy( name, m, sizeof( name ));
COM_FixSlashes( name );
if( COM_CheckString( name ))
{
// check to see if model was properly precached
for( i = 1; i < MAX_MODELS && sv.model_precache[i][0]; i++ )
{
if( !Q_stricmp( sv.model_precache[i], m ))
if( !Q_stricmp( sv.model_precache[i], name ))
break;
}
if( i == MAX_MODELS )
{
Con_Printf( S_ERROR "no precache: %s\n", m );
Con_Printf( S_ERROR "no precache: %s\n", name );
return;
}
}
@@ -1223,7 +1228,7 @@ void pfnSetModel( edict_t *e, const char *m )
return;
}
if( COM_CheckString( m ))
if( COM_CheckString( name ))
{
e->v.model = MAKE_STRING( sv.model_precache[i] );
e->v.modelindex = i;
@@ -1250,18 +1255,23 @@ pfnModelIndex
*/
int pfnModelIndex( const char *m )
{
char name[MAX_QPATH];
int i;
if( !COM_CheckString( m ))
return 0;
if( *m == '\\' || *m == '/' ) m++;
Q_strncpy( name, m, sizeof( name ));
COM_FixSlashes( name );
for( i = 1; i < MAX_MODELS && sv.model_precache[i][0]; i++ )
{
if( !Q_stricmp( sv.model_precache[i], m ))
if( !Q_stricmp( sv.model_precache[i], name ))
return i;
}
Con_Printf( S_ERROR "no precache: %s\n", m );
Con_Printf( S_ERROR "no precache: %s\n", name );
return 0;
}
@@ -3421,10 +3431,7 @@ void pfnFadeClientVolume( const edict_t *pEdict, int fadePercent, int fadeOutSec
sv_client_t *cl;
if(( cl = SV_ClientFromEdict( pEdict, true )) == NULL )
{
MsgDev( D_ERROR, "SV_FadeClientVolume: client is not spawned!\n" );
return;
}
if( FBitSet( cl->flags, FCL_FAKECLIENT ))
return;
@@ -4575,7 +4582,7 @@ qboolean SV_ParseEdict( char **pfile, edict_t *ent )
COM_ParseVector( &pstart, origin, 3 );
Mem_Free( pkvd[i].szValue ); // release old value, so we don't need these
copystring( va( "%g %g %g", origin[0], origin[1], origin[2] - 16.0f ));
pkvd[i].szValue = copystring( va( "%g %g %g", origin[0], origin[1], origin[2] - 16.0f ));
}
#endif
if( !Q_strcmp( pkvd[i].szKeyName, "light" ))
+1 -1
View File
@@ -73,7 +73,7 @@ void Log_Open( void )
}
if( fp ) svs.log.file = fp;
Log_Printf( "Log file started (file \"%s\") (game \"%s\") (version \"%i/%.2f/%d\")\n",
Log_Printf( "Log file started (file \"%s\") (game \"%s\") (version \"%i/%s/%d\")\n",
szTestFile, Info_ValueForKey( SV_Serverinfo(), "*gamedir" ), PROTOCOL_VERSION, XASH_VERSION, Q_buildnum() );
}
+11 -8
View File
@@ -92,6 +92,7 @@ CVAR_DEFINE_AUTO( sv_skyvec_x, "0", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "skylight dir
CVAR_DEFINE_AUTO( sv_skyvec_y, "0", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "skylight direction by y-axis" );
CVAR_DEFINE_AUTO( sv_skyvec_z, "0", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "skylight direction by z-axis" );
CVAR_DEFINE_AUTO( sv_wateralpha, "1", FCVAR_MOVEVARS|FCVAR_UNLOGGED, "world surfaces water transparency factor. 1.0 - solid, 0.0 - fully transparent" );
CVAR_DEFINE_AUTO( sv_background_freeze, "1", FCVAR_ARCHIVE, "freeze player movement on background maps (e.g. to prevent falling)" );
CVAR_DEFINE_AUTO( showtriggers, "0", FCVAR_LATCH, "debug cvar shows triggers" );
CVAR_DEFINE_AUTO( sv_airmove, "1", FCVAR_SERVER, "obsolete, compatibility issues" );
CVAR_DEFINE_AUTO( sv_version, "", FCVAR_READ_ONLY, "engine version string" );
@@ -512,6 +513,9 @@ void SV_PrepWorldFrame( void )
ClearBits( ent->v.effects, EF_MUZZLEFLASH|EF_NOINTERP );
}
if( svgame.physFuncs.pfnPrepWorldFrame != NULL )
svgame.physFuncs.pfnPrepWorldFrame();
}
/*
@@ -648,9 +652,8 @@ void Master_Add( void )
NET_Config( true ); // allow remote
if( !NET_StringToAdr( MASTERSERVER_ADR, &adr ))
MsgDev( D_INFO, "Can't resolve adr: %s\n", MASTERSERVER_ADR );
NET_SendPacket( NS_SERVER, 2, "q\xFF", adr );
Con_Printf( "can't resolve adr: %s\n", MASTERSERVER_ADR );
else NET_SendPacket( NS_SERVER, 2, "q\xFF", adr );
}
/*
@@ -692,9 +695,8 @@ void Master_Shutdown( void )
NET_Config( true ); // allow remote
if( !NET_StringToAdr( MASTERSERVER_ADR, &adr ))
MsgDev( D_INFO, "Can't resolve addr: %s\n", MASTERSERVER_ADR );
NET_SendPacket( NS_SERVER, 2, "\x62\x0A", adr );
Con_Printf( "can't resolve addr: %s\n", MASTERSERVER_ADR );
else NET_SendPacket( NS_SERVER, 2, "\x62\x0A", adr );
}
/*
@@ -739,7 +741,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
Info_SetValueForKey( s, "os", "w", len ); // Windows
Info_SetValueForKey( s, "secure", "0", len ); // server anti-cheat
Info_SetValueForKey( s, "lan", "0", len ); // LAN servers doesn't send info to master
Info_SetValueForKey( s, "version", va( "%g", XASH_VERSION ), len ); // server region. 255 -- all regions
Info_SetValueForKey( s, "version", va( "%s", XASH_VERSION ), len ); // server region. 255 -- all regions
Info_SetValueForKey( s, "region", "255", len ); // server region. 255 -- all regions
Info_SetValueForKey( s, "product", GI->gamefolder, len ); // product? Where is the difference with gamedir?
@@ -847,13 +849,14 @@ void SV_Init( void )
Cvar_RegisterVariable (&violence_hgibs);
Cvar_RegisterVariable (&mp_logecho);
Cvar_RegisterVariable (&mp_logfile);
Cvar_RegisterVariable (&sv_background_freeze);
// when we in developer-mode automatically turn cheats on
if( host_developer.value ) Cvar_SetValue( "sv_cheats", 1.0f );
MSG_Init( &net_message, "NetMessage", net_message_buffer, sizeof( net_message_buffer ));
Q_snprintf( versionString, sizeof( versionString ), "%s: %.2f,%i,%i", "Xash3D", XASH_VERSION, PROTOCOL_VERSION, Q_buildnum() );
Q_snprintf( versionString, sizeof( versionString ), "%s: %s,%i,%i", "Xash3D", XASH_VERSION, PROTOCOL_VERSION, Q_buildnum() );
Cvar_FullSet( "sv_version", versionString, FCVAR_READ_ONLY );
SV_ClearGameState (); // delete all temporary *.hl files
+4 -4
View File
@@ -74,8 +74,8 @@ realcheck:
stop[2] = start[2] - 2.0f * svgame.movevars.stepsize;
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent, monsterClip );
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, ent, monsterClip );
if( trace.fraction == 1.0f )
return false;
@@ -91,8 +91,8 @@ realcheck:
start[1] = stop[1] = y ? maxs[1] : mins[1];
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL, ent, monsterClip );
trace = SV_MoveNoEnts( start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, ent, monsterClip );
if( trace.fraction != 1.0f && trace.endpos[2] > bottom )
bottom = trace.endpos[2];
+6 -7
View File
@@ -815,8 +815,8 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
if( blocked )
{
// more accuracy blocking code
if( flDamage <= 0.0f )
*blocked = !VectorCompare( ent->v.origin, end ); // can't move full distance
if( flDamage <= 0.0f && FBitSet( host.features, ENGINE_PHYSICS_PUSHER_EXT ))
*blocked = !VectorCompareEpsilon( ent->v.origin, end, ON_EPSILON ); // can't move full distance
else *blocked = true;
}
@@ -864,9 +864,8 @@ static qboolean SV_CanBlock( edict_t *ent )
if( ent->v.solid == SOLID_NOT || ent->v.solid == SOLID_TRIGGER )
{
// clear bounds for deadbody
ent->v.mins[0] = ent->v.mins[1] = 0.0f;
ent->v.maxs[0] = ent->v.maxs[1] = 0.0f;
ent->v.maxs[2] = ent->v.mins[2];
ent->v.mins[0] = ent->v.mins[1] = 0;
VectorCopy( ent->v.mins, ent->v.maxs );
return false;
}
@@ -936,7 +935,7 @@ static edict_t *SV_PushMove( edict_t *pusher, float movetime )
if( block ) continue;
// if the entity is standing on the pusher, it will definately be moved
if( !(( check->v.flags & FL_ONGROUND ) && check->v.groundentity == pusher ))
if( !( FBitSet( check->v.flags, FL_ONGROUND ) && check->v.groundentity == pusher ))
{
if( check->v.absmin[0] >= maxs[0]
|| check->v.absmin[1] >= maxs[1]
@@ -2046,7 +2045,7 @@ qboolean SV_InitPhysicsAPI( void )
{
if( pPhysIface( SV_PHYSICS_INTERFACE_VERSION, &gPhysicsAPI, &svgame.physFuncs ))
{
MsgDev( D_REPORT, "SV_LoadProgs: ^2initailized extended PhysicAPI ^7ver. %i\n", SV_PHYSICS_INTERFACE_VERSION );
Con_Reportf( "SV_LoadProgs: ^2initailized extended PhysicAPI ^7ver. %i\n", SV_PHYSICS_INTERFACE_VERSION );
if( svgame.physFuncs.SV_CheckFeatures != NULL )
{
+4 -4
View File
@@ -32,6 +32,9 @@ void SV_ClearPhysEnts( void )
qboolean SV_PlayerIsFrozen( edict_t *pClient )
{
if( sv_background_freeze.value && sv.background )
return true;
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
return false;
@@ -352,10 +355,7 @@ static void pfnStuckTouch( int hitent, pmtrace_t *tr )
}
if( svgame.pmove->numtouch >= MAX_PHYSENTS )
{
MsgDev( D_ERROR, "PM_StuckTouch: MAX_TOUCHENTS limit exceeded\n" );
return;
}
VectorCopy( svgame.pmove->velocity, tr->deltavelocity );
tr->ent = hitent;
@@ -567,7 +567,7 @@ void SV_InitClientMove( void )
for( i = 0; i < MAX_MAP_HULLS; i++ )
{
if( svgame.dllFuncs.pfnGetHullBounds( i, host.player_mins[i], host.player_maxs[i] ))
MsgDev( D_NOTE, "SV: hull%i, player_mins: %g %g %g, player_maxs: %g %g %g\n", i,
Con_Reportf( "SV: hull%i, player_mins: %g %g %g, player_maxs: %g %g %g\n", i,
host.player_mins[i][0], host.player_mins[i][1], host.player_mins[i][2],
host.player_maxs[i][0], host.player_maxs[i][1], host.player_maxs[i][2] );
}
+7 -7
View File
@@ -422,7 +422,7 @@ static int IsValidSave( void )
}
// ignore autosave during background
if( sv.background )
if( sv.background || UI_CreditsActive( ))
return 0;
if( svgame.physFuncs.SV_AllowSaveGame != NULL )
@@ -539,9 +539,6 @@ static qboolean SaveGetName( int lastnum, char *filename )
{
int a, b, c;
if( !COM_CheckString( filename ))
return false;
if( lastnum < 0 || lastnum > 999 )
return false;
@@ -664,7 +661,7 @@ static void SaveClear( SAVERESTOREDATA *pSaveData )
/*
=============
SaveInit
SaveFinish
release global save-restore buffer
=============
@@ -1790,7 +1787,7 @@ static int CreateEntityTransitionList( SAVERESTOREDATA *pSaveData, int levelMask
}
else
{
Con_DPrintf( "Transferring %s (%d)\n", STRING( pTable->classname ), NUM_FOR_EDICT( pent ));
Con_Reportf( "Transferring %s (%d)\n", STRING( pTable->classname ), NUM_FOR_EDICT( pent ));
if( svgame.dllFuncs.pfnRestore( pent, pSaveData, 0 ) < 0 )
{
@@ -1802,7 +1799,7 @@ static int CreateEntityTransitionList( SAVERESTOREDATA *pSaveData, int levelMask
{
// this can happen during normal processing - PVS is just a guess,
// some map areas won't exist in the new map
Con_DPrintf( "Suppressing %s\n", STRING( pTable->classname ));
Con_Reportf( "Suppressing %s\n", STRING( pTable->classname ));
SetBits( pent->v.flags, FL_KILLME );
}
else
@@ -2014,6 +2011,9 @@ qboolean SV_LoadGame( const char *pPath )
if( host.type == HOST_DEDICATED )
return false;
if( UI_CreditsActive( ))
return false;
if( !COM_CheckString( pPath ))
return false;
+18 -17
View File
@@ -28,7 +28,8 @@ typedef struct moveclip_s
edict_t *passedict;
trace_t trace;
int type; // move type
int flags; // trace flags
qboolean ignoretrans;
qboolean monsterclip;
} moveclip_t;
/*
@@ -820,18 +821,18 @@ returns true if the entity is in solid currently
*/
qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker )
{
trace_t trace;
qboolean monsterClip = FBitSet( ent->v.flags, FL_MONSTERCLIP ) ? true : false;
trace_t trace;
if( ent->v.flags & (FL_CLIENT|FL_FAKECLIENT))
if( FBitSet( ent->v.flags, FL_CLIENT|FL_FAKECLIENT ))
{
// to avoid falling through tracktrain update client mins\maxs here
if( ent->v.flags & FL_DUCKING )
if( FBitSet( ent->v.flags, FL_DUCKING ))
SV_SetMinMaxSize( ent, svgame.pmove->player_mins[1], svgame.pmove->player_maxs[1], true );
else SV_SetMinMaxSize( ent, svgame.pmove->player_mins[0], svgame.pmove->player_maxs[0], true );
}
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent, monsterClip );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent, monsterClip );
if( SV_IsValidEdict( blocker ) && SV_IsValidEdict( trace.ent ))
{
@@ -839,6 +840,7 @@ qboolean SV_TestEntityPosition( edict_t *ent, edict_t *blocker )
return trace.startsolid;
return false;
}
return trace.startsolid;
}
@@ -1159,18 +1161,15 @@ static qboolean SV_ClipToEntity( edict_t *touch, moveclip_t *clip )
if( svgame.dllFuncs2.pfnShouldCollide )
{
if( !svgame.dllFuncs2.pfnShouldCollide( touch, clip->passedict ))
return true; // originally this was 'return' but is completely wrong!
return true;
}
// monsterclip filter (solid custom is a static or dynamic bodies)
if( touch->v.solid == SOLID_BSP || touch->v.solid == SOLID_CUSTOM )
{
if( FBitSet( touch->v.flags, FL_MONSTERCLIP ))
{
// func_monsterclip works only with monsters that have same flag!
if( !FBitSet( clip->flags, FMOVE_MONSTERCLIP ))
return true;
}
// func_monsterclip works only with monsters that have same flag!
if( FBitSet( touch->v.flags, FL_MONSTERCLIP ) && !clip->monsterclip )
return true;
}
else
{
@@ -1181,7 +1180,7 @@ static qboolean SV_ClipToEntity( edict_t *touch, moveclip_t *clip )
mod = SV_ModelHandle( touch->v.modelindex );
if( mod && mod->type == mod_brush && FBitSet( clip->flags, FMOVE_IGNORE_GLASS ))
if( mod && mod->type == mod_brush && clip->ignoretrans )
{
// we ignore brushes with rendermode != kRenderNormal and without FL_WORLDBRUSH set
if( touch->v.rendermode != kRenderNormal && !FBitSet( touch->v.flags, FL_WORLDBRUSH ))
@@ -1226,7 +1225,7 @@ static qboolean SV_ClipToEntity( edict_t *touch, moveclip_t *clip )
if( touch->v.solid == SOLID_CUSTOM )
SV_CustomClipMoveToEntity( touch, clip->start, clip->mins, clip->maxs, clip->end, &trace );
else if( touch->v.flags & FL_MONSTER )
else if( FBitSet( touch->v.flags, FL_MONSTER ))
SV_ClipMoveToEntity( touch, clip->start, clip->mins2, clip->maxs2, clip->end, &trace );
else SV_ClipMoveToEntity( touch, clip->start, clip->mins, clip->maxs, clip->end, &trace );
@@ -1363,13 +1362,14 @@ trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end,
clip.start = start;
clip.end = trace_endpos;
clip.type = (type & 0xFF);
clip.flags = (type & 0xFF00);
clip.ignoretrans = type >> 8;
clip.monsterclip = false;
clip.passedict = (e) ? e : EDICT_NUM( 0 );
clip.mins = mins;
clip.maxs = maxs;
if( monsterclip && !FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
SetBits( clip.flags, FMOVE_MONSTERCLIP );
clip.monsterclip = true;
if( clip.type == MOVE_MISSILE )
{
@@ -1422,7 +1422,8 @@ trace_t SV_MoveNoEnts( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_
clip.start = start;
clip.end = trace_endpos;
clip.type = (type & 0xFF);
clip.flags = (type & 0xFF00);
clip.ignoretrans = type >> 8;
clip.monsterclip = false;
clip.passedict = (e) ? e : EDICT_NUM( 0 );
clip.mins = mins;
clip.maxs = maxs;