some stuff from ceepeepeecheck

This commit is contained in:
Alug committed 2024-04-20 22:54:00 +02:00
1 parent ea0cc41d04
commit d0c50006bc
9 files changed
+40 -23

No files matched your search

+6
View File
@@ -1445,6 +1445,12 @@ void Command_Ping_f(void)
pingv[pingc].ms = ms;
pingc++;
}
else
{
pingv[pingc].num = 0;
pingv[pingc].f = 0;
pingv[pingc].ms = 0;
}
}
if (f_width < 10) f_width = 1;
+1 -5
View File
@@ -2659,13 +2659,9 @@ void D_ModifyClientVote(SINT8 voted, UINT8 splitplayer)
{
char buf[2];
char *p = buf;
UINT8 player = consoleplayer;
if (splitplayer > 0)
player = displayplayers[splitplayer];
WRITESINT8(p, voted);
WRITEUINT8(p, player);
WRITEUINT8(p, splitplayer);
SendNetXCmd(XD_MODIFYVOTE, &buf, 2);
}
+5 -1
View File
@@ -8940,7 +8940,11 @@ static char *lua_enumlib_sprintf_upper(char **buf, int* size, const char *format
if (length > *size)
{
void *ptr = realloc(*buf, length+1);
if (!ptr) return NULL;
if (!ptr)
{
va_end(va);
return NULL;
}
*buf = ptr;
*size = length+1;
+1 -1
View File
@@ -8377,7 +8377,7 @@ void G_SaveDemo(void)
size_t i, strindex = 0;
boolean dash = true;
for (i = 0; demo.titlename[i] && i < 127; i++)
for (i = 0; i < 127 && demo.titlename[i]; i++)
{
if ((demo.titlename[i] >= 'a' && demo.titlename[i] <= 'z') ||
(demo.titlename[i] >= '0' && demo.titlename[i] <= '9'))
+7 -3
View File
@@ -4908,11 +4908,11 @@ void HWR_ProjectSprite(mobj_t *thing)
size_t lumpoff;
unsigned rot;
UINT8 flip;
boolean mirrored = thing->mirrored;
boolean hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored);
boolean mirrored;
boolean hflip;
angle_t ang, camang;
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
boolean papersprite;
INT32 heightsec, phs;
INT32 dist = -1;
@@ -4931,6 +4931,10 @@ void HWR_ProjectSprite(mobj_t *thing)
if (!thing)
return;
mirrored = thing->mirrored;
hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored);
papersprite = (thing->frame & FF_PAPERSPRITE);
if (cv_grmaxinterpdist.value)
dist = R_QuickCamDist(thing->x, thing->y);
+9 -2
View File
@@ -531,7 +531,8 @@ static void HU_removeChatText_Log(void)
free(chat_log[0]);
size_t i;
for(i=0;i<chat_nummsg_log-1;i++) {
for(i=0;i<chat_nummsg_log-1;i++)
{
chat_log[i] = chat_log[i+1];
}
chat_nummsg_log--; // lost 1 msg.
@@ -549,7 +550,13 @@ static void Chatlogsize_OnChange(void)
#define reallocarray(ptr, nmemb, size) realloc(ptr, (nmemb)*(size))
// TODO - use z_zone allocators?
chat_log = reallocarray(chat_log, cv_chatlogsize.value, sizeof(char*));
char **new_chat_log = reallocarray(chat_log, cv_chatlogsize.value, sizeof(char*));
if (new_chat_log == NULL)
{
free(chat_log);
return;
}
chat_log = new_chat_log;
#undef reallocarray
chat_nummsg_log = min(chat_nummsg_log, (UINT32)cv_chatlogsize.value);
+3
View File
@@ -896,7 +896,10 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
socklen_t len = sizeof(sin);
if (s == (SOCKET_TYPE)ERRSOCKET)
{
close(s);
return (SOCKET_TYPE)ERRSOCKET;
}
#ifdef USE_WINSOCK
{ // Alam_GBC: disable the new UDP connection reset behavior for Win2k and up
#ifdef USE_WINSOCK2
+7 -10
View File
@@ -2510,18 +2510,15 @@ static void P_MovePlayer(player_t *player)
if ((player->mo->ceilingz - player->mo->floorz < player->mo->height)
&& !(player->mo->flags & MF_NOCLIP))
{
if (player->mo->ceilingz - player->mo->floorz < player->mo->height)
if ((netgame || multiplayer) && player->spectator)
P_DamageMobj(player->mo, NULL, NULL, 42000); // Respawn crushed spectators
else
{
if ((netgame || multiplayer) && player->spectator)
P_DamageMobj(player->mo, NULL, NULL, 42000); // Respawn crushed spectators
else
{
K_SquishPlayer(player, NULL, NULL); // SRB2kart - we don't kill when squished, we squish when squished.
}
if (player->playerstate == PST_DEAD)
return;
K_SquishPlayer(player, NULL, NULL); // SRB2kart - we don't kill when squished, we squish when squished.
}
if (player->playerstate == PST_DEAD)
return;
}
#ifdef HWRENDER
+1 -1
View File
@@ -1486,7 +1486,7 @@ void Y_VoteTicker(void)
if ((InputDown(gc_accelerate, i+1) || JoyAxis(AXISMOVE, i+1) > 0) && !pressed)
{
D_ModifyClientVote(voteclient.playerinfo[i].selection, i);
D_ModifyClientVote(voteclient.playerinfo[i].selection, p);
pressed = true;
}
}