Merge branch 'next' into fix-167

This commit is contained in:
Lactozilla 2024-02-18 22:16:26 -03:00
commit 5119ec89f0
9 changed files with 39 additions and 14 deletions

View file

@ -120,7 +120,7 @@ static void CONS_backcolor_Change(void);
#ifdef macintosh
#define CON_BUFFERSIZE 4096 // my compiler can't handle local vars >32k
#else
#define CON_BUFFERSIZE 16384
#define CON_BUFFERSIZE 32768
#endif
static char con_buffer[CON_BUFFERSIZE];

View file

@ -823,7 +823,7 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum)
void HWR_GetLevelFlat(levelflat_t *levelflat)
{
if (levelflat->type == LEVELFLAT_NONE)
if (levelflat->type == LEVELFLAT_NONE || levelflat->texture_id < 0)
{
HWR_SetCurrentTexture(NULL);
return;

View file

@ -620,7 +620,7 @@ static void Command_CSay_f(void)
DoSayCommand(0, 1, HU_CSAY);
}
static tic_t spam_tokens[MAXPLAYERS];
static tic_t spam_tokens[MAXPLAYERS] = { 1 }; // fill the buffer with 1 so the motd can be sent.
static tic_t spam_tics[MAXPLAYERS];
/** Receives a message, processing an ::XD_SAY command.

View file

@ -1098,15 +1098,23 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
fixed_t fheight = P_GetSectorFloorZAt(sec, mt->x << FRACBITS, mt->y << FRACBITS);
mt->z = (UINT16)((player->mo->z - fheight)>>FRACBITS);
}
mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle)));
mt->options = (mt->z << ZSHIFT) | (UINT16)cv_opflags.value;
mt->options = (UINT16)cv_opflags.value;
mt->scale = player->mo->scale;
mt->spritexscale = player->mo->spritexscale;
mt->spriteyscale = player->mo->spriteyscale;
memset(mt->args, 0, NUMMAPTHINGARGS*sizeof(*mt->args));
memset(mt->stringargs, 0x00, NUMMAPTHINGSTRINGARGS*sizeof(*mt->stringargs));
mt->pitch = mt->roll = 0;
// Ignore offsets
if (mt->type == MT_EMBLEM)
mt->args[1] = 1;
else
mt->args[0] = 1;
return mt;
}

View file

@ -394,7 +394,7 @@ consvar_t cv_ps_descriptor = CVAR_INIT ("ps_descriptor", "Average", 0, ps_descri
consvar_t cv_freedemocamera = CVAR_INIT("freedemocamera", "Off", CV_SAVE, CV_OnOff, NULL);
// NOTE: this should be in hw_main.c, but we can't put it there as it breaks dedicated build
consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowclientshaders", "On", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowcustomshaders", "On", CV_NETVAR, CV_OnOff, NULL);
char timedemo_name[256];
boolean timedemo_csv;
@ -4663,15 +4663,28 @@ static void Command_Cheats_f(void)
CV_ResetCheatNetVars();
return;
}
else if (COM_CheckParm("on"))
{
if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else
G_SetUsedCheats(false);
return;
}
if (usedCheats)
CONS_Printf(M_GetText("Cheats are enabled, the game cannot be saved.\n"));
else
CONS_Printf(M_GetText("Cheats are disabled, the game can be saved.\n"));
if (CV_CheatsEnabled())
{
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed.\n"));
if (server || (IsPlayerAdmin(consoleplayer)))
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
}
else
CONS_Printf(M_GetText("No CHEAT-marked variables are changed -- Cheats are disabled.\n"));
CONS_Printf(M_GetText("No CHEAT-marked variables are changed.\n"));
}
#ifdef _DEBUG

View file

@ -1640,7 +1640,7 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
#endif
// Set user agent, as some servers won't accept invalid user agents.
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("Sonic Robo Blast 2/v%d.%d", VERSION, SUBVERSION));
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("Sonic Robo Blast 2/%s", VERSIONSTRING));
// Authenticate if the user so wishes
login = CURLGetLogin(url, NULL);

View file

@ -300,6 +300,10 @@ init_upnpc_once(struct upnpdata *upnpuserdata)
int upnp_error = -2;
int scope_id = 0;
int status_code = 0;
memset(&urls, 0, sizeof(struct UPNPUrls));
memset(&data, 0, sizeof(struct IGDdatas));
CONS_Printf(M_GetText("Looking for UPnP Internet Gateway Device\n"));
devlist = upnpDiscoverDevices(deviceTypes, 500, NULL, NULL, 0, false, 2, &upnp_error, 0);
if (devlist)
@ -327,8 +331,6 @@ init_upnpc_once(struct upnpdata *upnpuserdata)
parserootdesc(descXML, descXMLsize, &data);
free(descXML);
descXML = NULL;
memset(&urls, 0, sizeof(struct UPNPUrls));
memset(&data, 0, sizeof(struct IGDdatas));
GetUPNPUrls(&urls, &data, dev->descURL, status_code);
I_AddExitFunc(I_ShutdownUPnP);
}

View file

@ -10294,6 +10294,8 @@ void P_MobjThinker(mobj_t *mobj)
P_SetTarget(&mobj->hnext, NULL);
if (mobj->hprev && P_MobjWasRemoved(mobj->hprev))
P_SetTarget(&mobj->hprev, NULL);
if (mobj->dontdrawforviewmobj && P_MobjWasRemoved(mobj->dontdrawforviewmobj))
P_SetTarget(&mobj->dontdrawforviewmobj, NULL);
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG);
@ -10867,9 +10869,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
)))
mobj->flags2 |= MF2_DONTRESPAWN;
if (!(mobj->flags & MF_NOTHINK))
P_AddThinker(THINK_MOBJ, &mobj->thinker);
if (type == MT_PLAYER)
{
// when spawning MT_PLAYER, set mobj->player before calling MobjSpawn hook to prevent P_RemoveMobj from succeeding on player mobj.
@ -10879,6 +10878,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
va_end(args);
}
if (!(mobj->flags & MF_NOTHINK) || (titlemapinaction && mobj->type == MT_ALTVIEWMAN))
P_AddThinker(THINK_MOBJ, &mobj->thinker);
// increment mobj reference, so we don't get a dangling reference in case MobjSpawn calls P_RemoveMobj
mobj->thinker.references++;

View file

@ -444,7 +444,7 @@ static void R_DrawRepeatMaskedColumn(column_t *col, unsigned lengthcol)
{
while (sprtopscreen < sprbotscreen) {
R_DrawMaskedColumn(col, lengthcol);
if ((INT64)sprtopscreen + dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
if ((INT64)sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
sprtopscreen = INT32_MAX;
else
sprtopscreen += dc_texheight*spryscale;