Fix dedicated compiling errors

This commit is contained in:
Alibek Omarov 2018-06-14 20:31:46 +03:00
parent b5c621ae36
commit d0ff201da2
7 changed files with 15 additions and 6 deletions

View File

@ -351,7 +351,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
{
pinq1 = (dsprite_q1_t *)buffer;
size = sizeof( msprite_t ) + ( pinq1->numframes - 1 ) * sizeof( psprite->frames );
psprite = Mem_Alloc( mod->mempool, size );
psprite = Mem_Calloc( mod->mempool, size );
mod->cache.data = psprite; // make link to extradata
psprite->type = pinq1->type;
@ -371,7 +371,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
{
pinhl = (dsprite_hl_t *)buffer;
size = sizeof( msprite_t ) + ( pinhl->numframes - 1 ) * sizeof( psprite->frames );
psprite = Mem_Alloc( mod->mempool, size );
psprite = Mem_Calloc( mod->mempool, size );
mod->cache.data = psprite; // make link to extradata
psprite->type = pinhl->type;

View File

@ -2701,7 +2701,9 @@ qboolean Mod_LoadBmodelLumps( const byte *mod_base, qboolean isworld )
if( isworld )
{
loadmodel = mod; // restore pointer to world
#ifndef XASH_DEDICATED
Mod_InitDebugHulls(); // FIXME: build hulls for separate bmodels (shells, medkits etc)
#endif // XASH_DEDICATED
}
for( i = 0; i < bmod->wadlist.count; i++ )

View File

@ -1101,7 +1101,7 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
}
#else
// just copy model into memory
loadmodel->cache.data = Mem_Alloc( loadmodel->mempool, phdr->length );
loadmodel->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length );
memcpy( loadmodel->cache.data, buffer, phdr->length );
phdr = loadmodel->cache.data;

View File

@ -164,7 +164,9 @@ void Mod_FreeAll( void )
{
int i;
#ifndef XASH_DEDICATED
Mod_ReleaseHullPolygons();
#endif
for( i = 0; i < mod_numknown; i++ )
Mod_FreeModel( &mod_known[i] );
mod_numknown = 0;
@ -414,8 +416,9 @@ static void Mod_PurgeStudioCache( void )
// refresh hull data
SetBits( r_showhull->flags, FCVAR_CHANGED );
#ifndef XASH_DEDICATED
Mod_ReleaseHullPolygons();
#endif
// release previois map
Mod_FreeModel( mod_known ); // world is stuck on slot #0 always

View File

@ -436,7 +436,7 @@ int NET_GetHostByName( const char *hostname )
return ip;
#else
struct hostent *h;
if(!( h = pGetHostByName( copy )))
if(!( h = pGetHostByName( hostname )))
return 0;
return *(int *)h->h_addr_list[0];
#endif

View File

@ -668,8 +668,10 @@ print into window console
*/
void Sys_Print( const char *pMsg )
{
#ifndef XASH_DEDICATED
if( !Host_IsDedicated() )
Con_Print( pMsg );
#endif
#ifdef _WIN32
{
@ -680,8 +682,10 @@ void Sys_Print( const char *pMsg )
char *c = logbuf;
int i = 0;
if( host.type == HOST_NORMAL )
#ifndef XASH_DEDICATED
if( !Host_IsDedicated() )
Con_Print( pMsg );
#endif
// if the message is REALLY long, use just the last portion of it
if( Q_strlen( pMsg ) > sizeof( buffer ) - 1 )