Merge remote-tracking branch 'refs/remotes/origin/master' into buuump

This commit is contained in:
TehRealSalt 2018-01-03 20:02:53 -05:00
commit 0e48e6f0b6
20 changed files with 157 additions and 69 deletions

1
.gitignore vendored
View file

@ -18,3 +18,4 @@ Win32_LIB_ASM_Release
*.user *.user
*.db *.db
*.opendb *.opendb
/.vs

View file

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(SRB2 project(SRB2
VERSION 2.1.19 VERSION 2.1.20
LANGUAGES C) LANGUAGES C)
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})

View file

@ -17,7 +17,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<AssemblerOutput>All</AssemblerOutput> <AssemblerOutput>All</AssemblerOutput>
<SmallerTypeCheck>true</SmallerTypeCheck> <SmallerTypeCheck>false</SmallerTypeCheck>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile> </ClCompile>
<Link> <Link>

View file

@ -1,4 +1,4 @@
version: 2.1.19.{branch}-{build} version: 2.1.20.{branch}-{build}
os: MinGW os: MinGW
environment: environment:

View file

@ -26,6 +26,7 @@
#include "p_local.h" #include "p_local.h"
#include "p_setup.h" #include "p_setup.h"
#include "s_sound.h" #include "s_sound.h"
#include "i_sound.h"
#include "m_misc.h" #include "m_misc.h"
#include "am_map.h" #include "am_map.h"
#include "byteptr.h" #include "byteptr.h"
@ -135,6 +136,7 @@ static void Command_Playintro_f(void);
static void Command_Displayplayer_f(void); static void Command_Displayplayer_f(void);
static void Command_Tunes_f(void); static void Command_Tunes_f(void);
static void Command_RestartAudio_f(void);
static void Command_ExitLevel_f(void); static void Command_ExitLevel_f(void);
static void Command_Showmap_f(void); static void Command_Showmap_f(void);
@ -757,6 +759,7 @@ void D_RegisterClientCommands(void)
COM_AddCommand("displayplayer", Command_Displayplayer_f); COM_AddCommand("displayplayer", Command_Displayplayer_f);
COM_AddCommand("tunes", Command_Tunes_f); COM_AddCommand("tunes", Command_Tunes_f);
COM_AddCommand("restartaudio", Command_RestartAudio_f);
CV_RegisterVar(&cv_resetmusic); CV_RegisterVar(&cv_resetmusic);
// FIXME: not to be here.. but needs be done for config loading // FIXME: not to be here.. but needs be done for config loading
@ -3454,8 +3457,31 @@ static void Command_Addfile(void)
if (*p == '\\' || *p == '/' || *p == ':') if (*p == '\\' || *p == '/' || *p == ':')
break; break;
++p; ++p;
// check total packet size and no of files currently loaded
{
size_t packetsize = 0;
serverinfo_pak *dummycheck = NULL;
// Shut the compiler up.
(void)dummycheck;
// See W_LoadWadFile in w_wad.c
for (i = 0; i < numwadfiles; i++)
packetsize += nameonlylength(wadfiles[i]->filename) + 22;
packetsize += nameonlylength(fn) + 22;
if ((numwadfiles >= MAX_WADFILES)
|| (packetsize > sizeof(dummycheck->fileneeded)))
{
CONS_Alert(CONS_ERROR, M_GetText("Too many files loaded to add %s\n"), fn);
return;
}
}
WRITESTRINGN(buf_p,p,240); WRITESTRINGN(buf_p,p,240);
// calculate and check md5
{ {
UINT8 md5sum[16]; UINT8 md5sum[16];
#ifdef NOMD5 #ifdef NOMD5
@ -3473,6 +3499,15 @@ static void Command_Addfile(void)
} }
else // file not found else // file not found
return; return;
for (i = 0; i < numwadfiles; i++)
{
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
{
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), fn);
return;
}
}
#endif #endif
WRITEMEM(buf_p, md5sum, 16); WRITEMEM(buf_p, md5sum, 16);
} }
@ -3701,9 +3736,9 @@ static void Command_ListWADS_f(void)
static void Command_Version_f(void) static void Command_Version_f(void)
{ {
#ifdef DEVELOP #ifdef DEVELOP
CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime); CONS_Printf("SRB2Kart %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime);
#else #else
CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision); CONS_Printf("SRB2Kart %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision);
#endif #endif
} }
@ -4352,6 +4387,27 @@ static void Command_Tunes_f(void)
} }
} }
static void Command_RestartAudio_f(void)
{
if (dedicated) // No point in doing anything if game is a dedicated server.
return;
S_StopMusic();
I_ShutdownMusic();
I_ShutdownSound();
I_StartupSound();
I_InitMusic();
// These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value);
I_SetDigMusicVolume(cv_digmusicvolume.value);
I_SetMIDIMusicVolume(cv_midimusicvolume.value);
if (Playing()) // Gotta make sure the player is in a level
P_RestoreMusic(&players[consoleplayer]);
}
/** Quits a game and returns to the title screen. /** Quits a game and returns to the title screen.
* *
*/ */

View file

@ -172,7 +172,7 @@ extern FILE *logstream;
// The string used in the alert that pops up in the event of an update being available. // The string used in the alert that pops up in the event of an update being available.
// Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!). // Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!).
#define UPDATE_ALERT_STRING \ #define UPDATE_ALERT_STRING \
"A new update is available for SRB2kart.\n"\ "A new update is available for SRB2Kart.\n"\
"Please visit the forums on SRB2.org to download it.\n"\ "Please visit the forums on SRB2.org to download it.\n"\
"\n"\ "\n"\
"You are using version: %s\n"\ "You are using version: %s\n"\
@ -189,7 +189,7 @@ extern FILE *logstream;
// The string used in the I_Error alert upon trying to host through command line parameters. // The string used in the I_Error alert upon trying to host through command line parameters.
// Generally less filled with newlines, since Windows gives you lots more room to work with. // Generally less filled with newlines, since Windows gives you lots more room to work with.
#define UPDATE_ALERT_STRING_CONSOLE \ #define UPDATE_ALERT_STRING_CONSOLE \
"A new update is available for SRB2kart.\n"\ "A new update is available for SRB2Kart.\n"\
"Please visit the forums on SRB2.org to download it.\n"\ "Please visit the forums on SRB2.org to download it.\n"\
"\n"\ "\n"\
"You are using version: %s\n"\ "You are using version: %s\n"\
@ -205,7 +205,7 @@ extern FILE *logstream;
// Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc. // Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc.
#define CODEBASE 210 #define CODEBASE 210
// The Modification ID; must be obtained from Inuyasha ( http://mb.srb2.org/private.php?do=newpm&u=2604 ). // The Modification ID; must be obtained from Rob ( https://mb.srb2.org/private.php?do=newpm&u=546 ).
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server. // DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
// "12" is the default mod ID for version 2.1 // "12" is the default mod ID for version 2.1
#define MODID 12 #define MODID 12

View file

@ -122,6 +122,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary> <ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -166,6 +167,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary> <ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -212,6 +214,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary> <ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -258,6 +261,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary> <ImportLibrary>$(IntDir)r_opengl.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View file

@ -125,6 +125,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary> <ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -170,6 +171,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary> <ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -216,6 +218,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary> <ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
@ -262,6 +265,7 @@
</DataExecutionPrevention> </DataExecutionPrevention>
<ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary> <ImportLibrary>$(IntDir)s_openal.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine> <TargetMachine>MachineX64</TargetMachine>
<SubSystem>Windows</SubSystem>
</Link> </Link>
<Bscmake> <Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>

View file

@ -215,7 +215,6 @@ static UINT8 UPNP_support = TRUE;
#if defined (USE_WINSOCK) && !defined (NONET) #if defined (USE_WINSOCK) && !defined (NONET)
typedef SOCKET SOCKET_TYPE; typedef SOCKET SOCKET_TYPE;
#define BADSOCKET INVALID_SOCKET
#define ERRSOCKET (SOCKET_ERROR) #define ERRSOCKET (SOCKET_ERROR)
#else #else
#if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__) || defined(_PS3) #if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__) || defined(_PS3)
@ -223,7 +222,6 @@ typedef int SOCKET_TYPE;
#else #else
typedef unsigned long SOCKET_TYPE; typedef unsigned long SOCKET_TYPE;
#endif #endif
#define BADSOCKET (SOCKET_TYPE)(~0)
#define ERRSOCKET (-1) #define ERRSOCKET (-1)
#endif #endif
@ -232,10 +230,10 @@ typedef int socklen_t;
#endif #endif
#ifndef NONET #ifndef NONET
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {BADSOCKET}; static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
static size_t mysocketses = 0; static size_t mysocketses = 0;
static int myfamily[MAXNETNODES+1] = {0}; static int myfamily[MAXNETNODES+1] = {0};
static SOCKET_TYPE nodesocket[MAXNETNODES+1] = {BADSOCKET}; static SOCKET_TYPE nodesocket[MAXNETNODES+1] = {ERRSOCKET};
static mysockaddr_t clientaddress[MAXNETNODES+1]; static mysockaddr_t clientaddress[MAXNETNODES+1];
static mysockaddr_t broadcastaddress[MAXNETNODES+1]; static mysockaddr_t broadcastaddress[MAXNETNODES+1];
static size_t broadcastaddresses = 0; static size_t broadcastaddresses = 0;
@ -647,7 +645,7 @@ static boolean FD_CPY(fd_set *src, fd_set *dst, SOCKET_TYPE *fd, size_t len)
FD_ZERO(dst); FD_ZERO(dst);
for (i = 0; i < len;i++) for (i = 0; i < len;i++)
{ {
if(fd[i] != BADSOCKET && fd[i] != (SOCKET_TYPE)ERRSOCKET && if(fd[i] != (SOCKET_TYPE)ERRSOCKET &&
FD_ISSET(fd[i], src) && !FD_ISSET(fd[i], dst)) // no checking for dups FD_ISSET(fd[i], src) && !FD_ISSET(fd[i], dst)) // no checking for dups
{ {
FD_SET(fd[i], dst); FD_SET(fd[i], dst);
@ -725,7 +723,7 @@ static void SOCK_Send(void)
} }
return; return;
} }
else if (nodesocket[doomcom->remotenode] == BADSOCKET) else if (nodesocket[doomcom->remotenode] == (SOCKET_TYPE)ERRSOCKET)
{ {
for (i = 0; i < mysocketses; i++) for (i = 0; i < mysocketses; i++)
{ {
@ -777,7 +775,7 @@ static void SOCK_FreeNodenum(INT32 numnode)
DEBFILE(va("Free node %d (%s)\n", numnode, SOCK_GetNodeAddress(numnode))); DEBFILE(va("Free node %d (%s)\n", numnode, SOCK_GetNodeAddress(numnode)));
nodeconnected[numnode] = false; nodeconnected[numnode] = false;
nodesocket[numnode] = BADSOCKET; nodesocket[numnode] = ERRSOCKET;
// put invalid address // put invalid address
memset(&clientaddress[numnode], 0, sizeof (clientaddress[numnode])); memset(&clientaddress[numnode], 0, sizeof (clientaddress[numnode]));
@ -804,7 +802,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
#endif #endif
mysockaddr_t straddr; mysockaddr_t straddr;
if (s == (SOCKET_TYPE)ERRSOCKET || s == BADSOCKET) if (s == (SOCKET_TYPE)ERRSOCKET)
return (SOCKET_TYPE)ERRSOCKET; return (SOCKET_TYPE)ERRSOCKET;
#ifdef USE_WINSOCK #ifdef USE_WINSOCK
{ // Alam_GBC: disable the new UDP connection reset behavior for Win2k and up { // Alam_GBC: disable the new UDP connection reset behavior for Win2k and up
@ -911,9 +909,9 @@ static boolean UDP_Socket(void)
for (s = 0; s < mysocketses; s++) for (s = 0; s < mysocketses; s++)
mysockets[s] = BADSOCKET; mysockets[s] = ERRSOCKET;
for (s = 0; s < MAXNETNODES+1; s++) for (s = 0; s < MAXNETNODES+1; s++)
nodesocket[s] = BADSOCKET; nodesocket[s] = ERRSOCKET;
FD_ZERO(&masterset); FD_ZERO(&masterset);
s = 0; s = 0;
@ -1250,7 +1248,6 @@ static void SOCK_CloseSocket(void)
for (i=0; i < MAXNETNODES+1; i++) for (i=0; i < MAXNETNODES+1; i++)
{ {
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
&& mysockets[i] != BADSOCKET
&& FD_ISSET(mysockets[i], &masterset)) && FD_ISSET(mysockets[i], &masterset))
{ {
#if !defined (__DJGPP__) || defined (WATTCP) #if !defined (__DJGPP__) || defined (WATTCP)
@ -1258,7 +1255,7 @@ static void SOCK_CloseSocket(void)
close(mysockets[i]); close(mysockets[i]);
#endif #endif
} }
mysockets[i] = BADSOCKET; mysockets[i] = ERRSOCKET;
} }
} }
#endif #endif

View file

@ -231,6 +231,8 @@ boolean LUAh_MobjHook(mobj_t *mo, enum hook which)
if (!gL || !(hooksAvailable[which/8] & (1<<(which%8)))) if (!gL || !(hooksAvailable[which/8] & (1<<(which%8))))
return false; return false;
I_Assert(mo->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic mobj hooks // Look for all generic mobj hooks
@ -406,6 +408,8 @@ UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
if (!gL || !(hooksAvailable[which/8] & (1<<(which%8)))) if (!gL || !(hooksAvailable[which/8] & (1<<(which%8))))
return 0; return 0;
I_Assert(thing1->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic mobj collision hooks // Look for all generic mobj collision hooks
@ -479,6 +483,8 @@ boolean LUAh_MobjThinker(mobj_t *mo)
if (!gL || !(hooksAvailable[hook_MobjThinker/8] & (1<<(hook_MobjThinker%8)))) if (!gL || !(hooksAvailable[hook_MobjThinker/8] & (1<<(hook_MobjThinker%8))))
return false; return false;
I_Assert(mo->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic mobj thinker hooks // Look for all generic mobj thinker hooks
@ -532,6 +538,8 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
if (!gL || !(hooksAvailable[hook_TouchSpecial/8] & (1<<(hook_TouchSpecial%8)))) if (!gL || !(hooksAvailable[hook_TouchSpecial/8] & (1<<(hook_TouchSpecial%8))))
return 0; return 0;
I_Assert(special->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic touch special hooks // Look for all generic touch special hooks
@ -595,6 +603,8 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
if (!gL || !(hooksAvailable[hook_ShouldDamage/8] & (1<<(hook_ShouldDamage%8)))) if (!gL || !(hooksAvailable[hook_ShouldDamage/8] & (1<<(hook_ShouldDamage%8))))
return 0; return 0;
I_Assert(target->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic should damage hooks // Look for all generic should damage hooks
@ -676,6 +686,8 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
if (!gL || !(hooksAvailable[hook_MobjDamage/8] & (1<<(hook_MobjDamage%8)))) if (!gL || !(hooksAvailable[hook_MobjDamage/8] & (1<<(hook_MobjDamage%8))))
return 0; return 0;
I_Assert(target->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic mobj damage hooks // Look for all generic mobj damage hooks
@ -747,6 +759,8 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source)
if (!gL || !(hooksAvailable[hook_MobjDeath/8] & (1<<(hook_MobjDeath%8)))) if (!gL || !(hooksAvailable[hook_MobjDeath/8] & (1<<(hook_MobjDeath%8))))
return 0; return 0;
I_Assert(target->type < NUMMOBJTYPES);
lua_settop(gL, 0); lua_settop(gL, 0);
// Look for all generic mobj death hooks // Look for all generic mobj death hooks

View file

@ -217,7 +217,6 @@ UINT16 current_port = 0;
#if (defined (_WIN32) || defined (_WIN32_WCE) || defined (_WIN32)) && !defined (NONET) #if (defined (_WIN32) || defined (_WIN32_WCE) || defined (_WIN32)) && !defined (NONET)
typedef SOCKET SOCKET_TYPE; typedef SOCKET SOCKET_TYPE;
#define BADSOCKET INVALID_SOCKET
#define ERRSOCKET (SOCKET_ERROR) #define ERRSOCKET (SOCKET_ERROR)
#else #else
#if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__) || defined (_PS3) #if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__) || defined (_PS3)
@ -225,7 +224,6 @@ typedef int SOCKET_TYPE;
#else #else
typedef unsigned long SOCKET_TYPE; typedef unsigned long SOCKET_TYPE;
#endif #endif
#define BADSOCKET (SOCKET_TYPE)(~0)
#define ERRSOCKET (-1) #define ERRSOCKET (-1)
#endif #endif
@ -234,7 +232,7 @@ typedef int socklen_t;
#endif #endif
#ifndef NONET #ifndef NONET
static SOCKET_TYPE socket_fd = BADSOCKET; // WINSOCK socket static SOCKET_TYPE socket_fd = ERRSOCKET; // WINSOCK socket
static struct timeval select_timeout; static struct timeval select_timeout;
static fd_set wset; static fd_set wset;
static size_t recvfull(SOCKET_TYPE s, char *buf, size_t len, int flags); static size_t recvfull(SOCKET_TYPE s, char *buf, size_t len, int flags);
@ -265,9 +263,9 @@ void AddMServCommands(void)
static void CloseConnection(void) static void CloseConnection(void)
{ {
#ifndef NONET #ifndef NONET
if (socket_fd != (SOCKET_TYPE)ERRSOCKET && socket_fd != BADSOCKET) if (socket_fd != (SOCKET_TYPE)ERRSOCKET)
close(socket_fd); close(socket_fd);
socket_fd = BADSOCKET; socket_fd = ERRSOCKET;
#endif #endif
} }
@ -385,7 +383,7 @@ static INT32 MS_Connect(const char *ip_addr, const char *str_port, INT32 async)
while (runp != NULL) while (runp != NULL)
{ {
socket_fd = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol); socket_fd = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol);
if (socket_fd != BADSOCKET && socket_fd != (SOCKET_TYPE)ERRSOCKET) if (socket_fd != (SOCKET_TYPE)ERRSOCKET)
{ {
if (async) // do asynchronous connection if (async) // do asynchronous connection
{ {

View file

@ -9296,6 +9296,16 @@ void P_RespawnSpecials(void)
if (mthing->type == mobjinfo[i].doomednum) if (mthing->type == mobjinfo[i].doomednum)
break; break;
if (i == NUMMOBJTYPES) // prevent creation of objects with this type -- Monster Iestyn 17/12/17
{
// 3D Mode start Thing is unlikely to be added to the que,
// so don't bother checking for that specific type
CONS_Alert(CONS_WARNING, M_GetText("P_RespawnSpecials: Unknown thing type %d attempted to respawn at (%d, %d)\n"), mthing->type, mthing->x, mthing->y);
// pull it from the que
iquetail = (iquetail+1)&(ITEMQUESIZE-1);
return;
}
//CTF rings should continue to respawn as normal rings outside of CTF. //CTF rings should continue to respawn as normal rings outside of CTF.
if (gametype != GT_CTF) if (gametype != GT_CTF)
{ {

View file

@ -5292,13 +5292,11 @@ static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
airbob->vars[2] = FRACUNIT; airbob->vars[2] = FRACUNIT;
if (noadjust) if (noadjust)
{
airbob->vars[7] = airbob->sector->ceilingheight-16*FRACUNIT; airbob->vars[7] = airbob->sector->ceilingheight-16*FRACUNIT;
airbob->vars[6] = airbob->vars[7]
- (sec->ceilingheight - sec->floorheight);
}
else else
airbob->vars[7] = airbob->sector->ceilingheight - P_AproxDistance(sourceline->dx, sourceline->dy); airbob->vars[7] = airbob->sector->ceilingheight - P_AproxDistance(sourceline->dx, sourceline->dy);
airbob->vars[6] = airbob->vars[7]
- (sec->ceilingheight - sec->floorheight);
airbob->vars[3] = airbob->vars[2]; airbob->vars[3] = airbob->vars[2];

View file

@ -148,7 +148,9 @@ int main(int argc, char **argv)
LoadLibraryA("exchndl.dll"); LoadLibraryA("exchndl.dll");
} }
} }
#ifndef __MINGW32__
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo); prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
#endif
MakeCodeWritable(); MakeCodeWritable();
#endif #endif
// startup SRB2 // startup SRB2

View file

@ -1214,7 +1214,7 @@
C01FCF4B08A954540054247B /* Debug */ = { C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.19; CURRENT_PROJECT_VERSION = 2.1.20;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)", "$(inherited)",
NORMALSRB2, NORMALSRB2,
@ -1226,7 +1226,7 @@
C01FCF4C08A954540054247B /* Release */ = { C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.19; CURRENT_PROJECT_VERSION = 2.1.20;
GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (

View file

@ -1214,7 +1214,7 @@
C01FCF4B08A954540054247B /* Debug */ = { C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.19; CURRENT_PROJECT_VERSION = 2.1.20;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)", "$(inherited)",
NORMALSRB2, NORMALSRB2,
@ -1226,7 +1226,7 @@
C01FCF4C08A954540054247B /* Release */ = { C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.19; CURRENT_PROJECT_VERSION = 2.1.20;
GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (

View file

@ -64,7 +64,7 @@ endif
ifdef SDL ifdef SDL
i_system_o+=$(OBJDIR)/SRB2.res i_system_o+=$(OBJDIR)/SRB2.res
i_main_o+=$(OBJDIR)/win_dbg.o #i_main_o+=$(OBJDIR)/win_dbg.o
ifndef NOHW ifndef NOHW
OPTS+=-DUSE_WGL_SWAP OPTS+=-DUSE_WGL_SWAP
endif endif
@ -81,7 +81,8 @@ endif
i_net_o=$(OBJDIR)/win_net.o i_net_o=$(OBJDIR)/win_net.o
i_system_o=$(OBJDIR)/win_sys.o $(OBJDIR)/SRB2.res i_system_o=$(OBJDIR)/win_sys.o $(OBJDIR)/SRB2.res
i_sound_o=$(OBJDIR)/win_snd.o i_sound_o=$(OBJDIR)/win_snd.o
i_main_o=$(OBJDIR)/win_dbg.o $(OBJDIR)/win_main.o i_main_o=$(OBJDIR)/win_main.o
#i_main_o+=$(OBJDIR)/win_dbg.o
OBJS=$(OBJDIR)/dx_error.o $(OBJDIR)/fabdxlib.o $(OBJDIR)/win_vid.o $(OBJDIR)/win_dll.o OBJS=$(OBJDIR)/dx_error.o $(OBJDIR)/fabdxlib.o $(OBJDIR)/win_vid.o $(OBJDIR)/win_dll.o
endif endif

View file

@ -244,7 +244,7 @@ static LRESULT CALLBACK MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPAR
D_PostEvent(&ev); D_PostEvent(&ev);
return TRUE; return TRUE;
} }
break;
case WM_XBUTTONDOWN: case WM_XBUTTONDOWN:
if (nodinput) if (nodinput)
{ {
@ -253,7 +253,7 @@ static LRESULT CALLBACK MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPAR
D_PostEvent(&ev); D_PostEvent(&ev);
return TRUE; return TRUE;
} }
break;
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
//I_OutputMsg("MW_WHEEL dispatched.\n"); //I_OutputMsg("MW_WHEEL dispatched.\n");
ev.type = ev_keydown; ev.type = ev_keydown;
@ -666,7 +666,9 @@ int WINAPI WinMain (HINSTANCE hInstance,
#endif #endif
LoadLibraryA("exchndl.dll"); LoadLibraryA("exchndl.dll");
#ifndef __MINGW32__
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo); prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
#endif
Result = HandledWinMain(hInstance); Result = HandledWinMain(hInstance);
#ifdef BUGTRAP #ifdef BUGTRAP

View file

@ -2581,7 +2581,7 @@ acquire:
UINT64 newbuttons = joybuttons ^ lastjoybuttons; UINT64 newbuttons = joybuttons ^ lastjoybuttons;
lastjoybuttons = joybuttons; lastjoybuttons = joybuttons;
for (i = 0; i < JOYBUTTONS && i < JOYBUTTONS_MAX; i++, j <<= 1) for (i = 0; i < JOYBUTTONS_MIN; i++, j <<= 1)
{ {
if (newbuttons & j) // button changed state? if (newbuttons & j) // button changed state?
{ {
@ -2601,7 +2601,7 @@ acquire:
UINT64 newhats = joyhats ^ lastjoyhats; UINT64 newhats = joyhats ^ lastjoyhats;
lastjoyhats = joyhats; lastjoyhats = joyhats;
for (i = 0; i < JOYHATS*4 && i < JOYHATS_MAX*4; i++, j <<= 1) for (i = 0; i < JOYHATS_MIN*4; i++, j <<= 1)
{ {
if (newhats & j) // button changed state? if (newhats & j) // button changed state?
{ {
@ -2825,7 +2825,7 @@ acquire:
UINT64 newbuttons = joybuttons ^ lastjoy2buttons; UINT64 newbuttons = joybuttons ^ lastjoy2buttons;
lastjoy2buttons = joybuttons; lastjoy2buttons = joybuttons;
for (i = 0; i < JOYBUTTONS && i < JOYBUTTONS_MAX; i++, j <<= 1) for (i = 0; i < JOYBUTTONS_MIN; i++, j <<= 1)
{ {
if (newbuttons & j) // button changed state? if (newbuttons & j) // button changed state?
{ {
@ -2845,7 +2845,7 @@ acquire:
UINT64 newhats = joyhats ^ lastjoy2hats; UINT64 newhats = joyhats ^ lastjoy2hats;
lastjoy2hats = joyhats; lastjoy2hats = joyhats;
for (i = 0; i < JOYHATS*4 && i < JOYHATS_MAX*4; i++, j <<= 1) for (i = 0; i < JOYHATS_MIN*4; i++, j <<= 1)
{ {
if (newhats & j) // button changed state? if (newhats & j) // button changed state?
{ {

View file

@ -322,6 +322,7 @@ static inline boolean I_SkipFrame(void)
case GS_LEVEL: case GS_LEVEL:
if (!paused) if (!paused)
return false; return false;
/* FALLTHRU */
case GS_TIMEATTACK: case GS_TIMEATTACK:
#ifndef CLIENT_LOADINGSCREEN #ifndef CLIENT_LOADINGSCREEN
case GS_WAITINGPLAYERS: case GS_WAITINGPLAYERS: