mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 03:51:32 +00:00
fixed crash on release build with code optimization
killed ms vs 8.0 warnings git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2322 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5a7115c80f
commit
380c94c6c1
4 changed files with 23 additions and 10 deletions
|
@ -1351,7 +1351,7 @@ void ParseMessage(sv_t *tv, char *buffer, int length, int to, int mask)
|
|||
if (tv->file)
|
||||
{
|
||||
fclose(tv->file);
|
||||
unlink(tv->downloadname);
|
||||
_unlink(tv->downloadname);
|
||||
Sys_Printf(tv->cluster, "Was already downloading %s\nOld download canceled\n");
|
||||
tv->file = NULL;
|
||||
}
|
||||
|
|
11
fteqtv/qtv.h
11
fteqtv/qtv.h
|
@ -669,15 +669,25 @@ unsigned int BSP_Checksum(bsp_t *bsp);
|
|||
int BSP_SphereLeafNums(bsp_t *bsp, int maxleafs, unsigned short *list, float x, float y, float z, float radius);
|
||||
qboolean BSP_Visible(bsp_t *bsp, int leafcount, unsigned short *list);
|
||||
void BSP_SetupForPosition(bsp_t *bsp, float x, float y, float z);
|
||||
void QW_SetViewersServer(viewer_t *viewer, sv_t *sv);
|
||||
unsigned short QCRC_Block (unsigned char *start, int count);
|
||||
void Netchan_OutOfBand (cluster_t *cluster, SOCKET sock, netadr_t adr, int length, unsigned char *data);
|
||||
void WriteDeltaUsercmd (netmsg_t *m, const usercmd_t *from, usercmd_t *move);
|
||||
void SendClientCommand(sv_t *qtv, char *fmt, ...);
|
||||
void QTV_Run(sv_t *qtv);
|
||||
|
||||
char *Rcon_Command(cluster_t *cluster, sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qboolean localcommand);
|
||||
char *COM_ParseToken (char *data, char *out, int outsize, const char *punctuation);
|
||||
char *Info_ValueForKey (char *s, const char *key, char *buffer, int buffersize);
|
||||
void Info_SetValueForStarKey (char *s, const char *key, const char *value, int maxsize);
|
||||
void ReadDeltaUsercmd (netmsg_t *m, const usercmd_t *from, usercmd_t *move);
|
||||
unsigned Com_BlockChecksum (void *buffer, int length);
|
||||
|
||||
void Sys_Printf(cluster_t *cluster, char *fmt, ...);
|
||||
#ifdef _WIN32
|
||||
int snprintf(char *buffer, int buffersize, char *format, ...);
|
||||
#endif
|
||||
#if (defined(_WIN32) && !defined(_VC80_UPGRADE))
|
||||
int vsnprintf(char *buffer, int buffersize, char *format, va_list argptr);
|
||||
#endif
|
||||
|
||||
|
@ -685,4 +695,3 @@ qboolean Net_FileProxy(sv_t *qtv, char *filename);
|
|||
sv_t *QTV_NewServerConnection(cluster_t *cluster, char *server, qboolean force, qboolean autoclose, qboolean noduplicates);
|
||||
SOCKET Net_MVDListen(int port);
|
||||
qboolean Net_StopFileProxy(sv_t *qtv);
|
||||
|
||||
|
|
16
fteqtv/qw.c
16
fteqtv/qw.c
|
@ -40,7 +40,9 @@ int snprintf(char *buffer, int buffersize, char *format, ...)
|
|||
|
||||
return ret;
|
||||
}
|
||||
int vsnprintf(char *buffer, int buffersize, char *format, va_list argptr)
|
||||
#endif
|
||||
#if (defined(_WIN32) && !defined(_VC80_UPGRADE))
|
||||
int vsnprintf(char *buffer, int buffersize, char *format, va_list argptr)
|
||||
{
|
||||
int ret;
|
||||
ret = _vsnprintf (buffer, buffersize, format, argptr);
|
||||
|
@ -289,16 +291,18 @@ int SendCurrentUserinfos(sv_t *tv, int cursize, netmsg_t *msg, int i, int thispl
|
|||
|
||||
for (; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if (i == thisplayer && !tv->controller)
|
||||
if (i == thisplayer && (!tv || !(tv->controller)))
|
||||
{
|
||||
WriteByte(msg, svc_updateuserinfo);
|
||||
WriteByte(msg, i);
|
||||
WriteLong(msg, i);
|
||||
WriteString2(msg, "\\*spectator\\1\\name\\");
|
||||
if (!tv || !*tv->hostname)
|
||||
WriteString(msg, "FTEQTV");
|
||||
else
|
||||
|
||||
if (tv && tv->hostname && tv->hostname[0])
|
||||
WriteString(msg, tv->hostname);
|
||||
else
|
||||
WriteString(msg, "FTEQTV");
|
||||
|
||||
|
||||
WriteByte(msg, svc_updatefrags);
|
||||
WriteByte(msg, i);
|
||||
|
@ -996,7 +1000,7 @@ void SendLocalPlayerState(sv_t *tv, viewer_t *v, int playernum, netmsg_t *msg)
|
|||
void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
|
||||
{
|
||||
packet_entities_t *e;
|
||||
int i,j;
|
||||
int i;
|
||||
usercmd_t to;
|
||||
unsigned short flags;
|
||||
short interp;
|
||||
|
|
|
@ -1826,9 +1826,9 @@ void Cluster_Run(cluster_t *cluster)
|
|||
char *result;
|
||||
char c;
|
||||
|
||||
if (!kbhit())
|
||||
if (!_kbhit())
|
||||
break;
|
||||
c = getch();
|
||||
c = _getch();
|
||||
|
||||
if (c == '\n' || c == '\r')
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue