Merge branch 'more-fixes-jug' into 'next'

Various gameplay & stability fixes

See merge request KartKrew/Kart-Public!256
This commit is contained in:
Sal 2021-07-06 13:42:41 -04:00
commit a0f0b473ab
6 changed files with 44 additions and 41 deletions

View file

@ -515,6 +515,10 @@ ifdef ZDEBUG
CPPFLAGS+=-DZDEBUG
endif
ifdef DUMPCONSISTENCY
CPPFLAGS+=-DDUMPCONSISTENCY
endif
ifdef DEVELOP
CPPFLAGS+=-DDEVELOP
endif

View file

@ -5011,7 +5011,7 @@ FILESTAMP
{
node = (SINT8)doomcom->remotenode;
if (netbuffer->packettype == PT_CLIENTJOIN && server)
if (netbuffer->packettype == PT_CLIENTJOIN && server && !levelloading)
{
HandleConnect(node);
continue;

View file

@ -341,15 +341,14 @@ static void DRPC_GotServerIP(UINT32 address)
{
const unsigned char * p = (const unsigned char *)&address;
sprintf(self_ip, "%u.%u.%u.%u:%u", p[0], p[1], p[2], p[3], current_port);
DRPC_UpdatePresence();
}
/*--------------------------------------------------
static const char *DRPC_GetServerIP(void)
Retrieves the IP address of the server that you're
connected to. Will attempt to use curl for getting your
own IP address, if it's not yours.
connected to. Will attempt to use STUN for getting your
own IP address.
--------------------------------------------------*/
static const char *DRPC_GetServerIP(void)
{
@ -362,8 +361,7 @@ static const char *DRPC_GetServerIP(void)
{
// We're not the server, so we could successfully get the IP!
// No need to do anything else :)
sprintf(self_ip, "%s:%u", address, current_port);
return self_ip;
return address;
}
}
@ -442,25 +440,6 @@ void DRPC_UpdatePresence(void)
// Server info
if (netgame)
{
if (DRPC_InvitesAreAllowed() == true)
{
const char *join;
// Grab the host's IP for joining.
if ((join = DRPC_GetServerIP()) != NULL)
{
char *xorjoin = DRPC_XORIPString(join);
discordPresence.joinSecret = xorjoin;
free(xorjoin);
joinSecretSet = true;
}
else
{
return;
}
}
if (cv_advertise.value)
{
discordPresence.state = "Public";
@ -473,6 +452,18 @@ void DRPC_UpdatePresence(void)
discordPresence.partyId = server_context; // Thanks, whoever gave us Mumble support, for implementing the EXACT thing Discord wanted for this field!
discordPresence.partySize = D_NumPlayers(); // Players in server
discordPresence.partyMax = discordInfo.maxPlayers; // Max players
if (DRPC_InvitesAreAllowed() == true)
{
const char *join;
// Grab the host's IP for joining.
if ((join = DRPC_GetServerIP()) != NULL)
{
discordPresence.joinSecret = DRPC_XORIPString(join);
joinSecretSet = true;
}
}
}
else
{

View file

@ -15757,7 +15757,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_BOUNCE|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_NOBLOCKMAP|MF_NOCLIP|MF_BOUNCE|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
@ -15904,7 +15904,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
sfx_tossed, // seesound
8, // reactiontime
sfx_None, // attacksound
256*FRACUNIT, // painstate
S_NULL, // painstate
100, // painchance
sfx_None, // painsound
S_NULL, // meleestate

View file

@ -894,7 +894,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp
POWERITEMODDS(newodds);
break;
case KITEM_THUNDERSHIELD:
if (thunderisout)
if (thunderisout || COOLDOWNONSTART)
newodds = 0;
else
POWERITEMODDS(newodds);
@ -952,6 +952,7 @@ static INT32 K_FindUseodds(player_t *player, fixed_t mashed, INT32 pingame, INT3
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator && players[i].mo
&& players[i].kartstuff[k_position] != 0
&& players[i].kartstuff[k_position] < player->kartstuff[k_position])
pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x,
players[i].mo->y - player->mo->y),
@ -5061,6 +5062,13 @@ INT32 K_GetKartDriftSparkValue(player_t *player)
static void K_KartDrift(player_t *player, boolean onground)
{
fixed_t minspeed = (10 * player->mo->scale);
// Grown players taking yellow spring panels will go below minspeed for one tic,
// and will then wrongdrift or have their sparks removed because of this.
// This fixes this problem.
if (player->kartstuff[k_pogospring] == 2 && player->mo->scale > mapobjectscale)
minspeed = FixedMul(10<<FRACBITS, mapobjectscale);
INT32 dsone = K_GetKartDriftSparkValue(player);
INT32 dstwo = dsone*2;
INT32 dsthree = dstwo*2;
@ -5116,14 +5124,14 @@ static void K_KartDrift(player_t *player, boolean onground)
{
// Starting left drift
player->kartstuff[k_drift] = 1;
player->kartstuff[k_driftend] = player->kartstuff[k_driftcharge] = 0;
player->kartstuff[k_driftend] = 0;
}
else if ((player->cmd.driftturn < 0) && player->speed > minspeed && player->kartstuff[k_jmp] == 1
&& (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != -1)
{
// Starting right drift
player->kartstuff[k_drift] = -1;
player->kartstuff[k_driftend] = player->kartstuff[k_driftcharge] = 0;
player->kartstuff[k_driftend] = 0;
}
else if (player->kartstuff[k_jmp] == 0) // || player->kartstuff[k_turndir] == 0)
{
@ -5968,7 +5976,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
if (player->kartstuff[k_offroad])
player->mo->friction -= 4912;
if (player->kartstuff[k_wipeoutslow] == 1)
if (player->kartstuff[k_wipeoutslow] == 1 && player->kartstuff[k_pogospring] == 0)
player->mo->friction -= 9824;
}
}

View file

@ -2691,8 +2691,8 @@ boolean M_Responder(event_t *ev)
M_QuitSRB2(0);
return true;
case KEY_F11: // Gamma Level
CV_AddValue(&cv_usegamma, 1);
case KEY_F11: // Fullscreen
CV_AddValue(&cv_fullscreen, 1);
return true;
// Spymode on F12 handled in game logic