Merge branch 'master' of https://git.magicalgirl.moe/STJr/SRB2Internal into levelheader-startrings

This commit is contained in:
Steel Titanium 2019-06-23 18:24:15 -04:00
commit 2e200a784c
6 changed files with 50 additions and 30 deletions

View file

@ -4100,7 +4100,7 @@ static void Command_ExitLevel_f(void)
CONS_Printf(M_GetText("This only works in a netgame.\n"));
else if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else if (gamestate != GS_LEVEL || demoplayback)
else if (( gamestate != GS_LEVEL && gamestate != GS_CREDITS ) || demoplayback)
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
else
SendNetXCmd(XD_EXITLEVEL, NULL, 0);

View file

@ -15,6 +15,7 @@
#include "console.h"
#include "d_main.h"
#include "d_player.h"
#include "d_clisrv.h"
#include "f_finale.h"
#include "p_setup.h"
#include "p_saveg.h"
@ -1847,7 +1848,9 @@ boolean G_Responder(event_t *ev)
if (F_CreditResponder(ev))
{
F_StartGameEvaluation();
// Skip credits for everyone
if (!netgame || server || IsPlayerAdmin(consoleplayer))
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
return true;
}
}
@ -2845,6 +2848,10 @@ void G_ExitLevel(void)
// Remove CEcho text on round end.
HU_ClearCEcho();
}
else if (gamestate == GS_CREDITS)
{
F_StartGameEvaluation();
}
}
// See also the enum GameType in doomstat.h

View file

@ -6268,7 +6268,7 @@ void A_MixUp(mobj_t *actor)
else if (numplayers == 2) // Special case -- simple swap
{
fixed_t x, y, z;
angle_t angle;
angle_t angle, drawangle;
INT32 one = -1, two = 0; // default value 0 to make the compiler shut up
// Zoom tube stuff
@ -6322,6 +6322,7 @@ void A_MixUp(mobj_t *actor)
y = players[one].mo->y;
z = players[one].mo->z;
angle = players[one].mo->angle;
drawangle = players[one].drawangle;
starpostx = players[one].starpostx;
starposty = players[one].starposty;
@ -6337,10 +6338,14 @@ void A_MixUp(mobj_t *actor)
players[two].starpostnum, players[two].starposttime, players[two].starpostangle,
players[two].mo->flags2);
players[one].drawangle = players[two].drawangle;
P_MixUp(players[two].mo, x, y, z, angle, starpostx, starposty, starpostz,
starpostnum, starposttime, starpostangle,
mflags2);
players[two].drawangle = drawangle;
//carry set after mixup. Stupid P_ResetPlayer() takes away some of the stuff we look for...
//but not all of it! So we need to make sure they aren't set wrong or anything.
players[one].powers[pw_carry] = carry2;
@ -6352,7 +6357,7 @@ void A_MixUp(mobj_t *actor)
else
{
fixed_t position[MAXPLAYERS][3];
angle_t anglepos[MAXPLAYERS];
angle_t anglepos[MAXPLAYERS][2];
INT32 pindex[MAXPLAYERS], counter = 0, teleportfrom = 0;
// Zoom tube stuff
@ -6371,7 +6376,7 @@ void A_MixUp(mobj_t *actor)
for (i = 0; i < MAXPLAYERS; i++)
{
position[i][0] = position[i][1] = position[i][2] = anglepos[i] = pindex[i] = -1;
position[i][0] = position[i][1] = position[i][2] = anglepos[i][0] = anglepos[i][1] = pindex[i] = -1;
teleported[i] = false;
}
@ -6387,7 +6392,8 @@ void A_MixUp(mobj_t *actor)
position[counter][1] = players[i].mo->y;
position[counter][2] = players[i].mo->z;
pindex[counter] = i;
anglepos[counter] = players[i].mo->angle;
anglepos[counter][0] = players[i].mo->angle;
anglepos[counter][1] = players[i].drawangle;
players[i].mo->momx = players[i].mo->momy = players[i].mo->momz =
players[i].rmomx = players[i].rmomy = 1;
players[i].cmomx = players[i].cmomy = 0;
@ -6439,11 +6445,13 @@ void A_MixUp(mobj_t *actor)
players[i].speed = transspeed[teleportfrom];
P_SetTarget(&players[i].mo->tracer, transtracer[teleportfrom]);
P_MixUp(players[i].mo, position[teleportfrom][0], position[teleportfrom][1], position[teleportfrom][2], anglepos[teleportfrom],
P_MixUp(players[i].mo, position[teleportfrom][0], position[teleportfrom][1], position[teleportfrom][2], anglepos[teleportfrom][0],
spposition[teleportfrom][0], spposition[teleportfrom][1], spposition[teleportfrom][2],
starpostnum[teleportfrom], starposttime[teleportfrom], starpostangle[teleportfrom],
flags2[teleportfrom]);
players[i].drawangle = anglepos[teleportfrom][1];
//...carry after. same reasoning.
players[i].powers[pw_carry] = transcarry[teleportfrom];
if (transcarry[teleportfrom] == CR_MINECART && transtracer[teleportfrom] && !(P_MobjWasRemoved(transtracer[teleportfrom])))

View file

@ -4514,7 +4514,7 @@ DoneSection2:
break;
}
player->mo->angle = lineangle;
player->mo->angle = player->drawangle = lineangle;
if (!demoplayback || P_AnalogMove(player))
{

View file

@ -125,12 +125,10 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
if (!P_TeleportMove(thing, x, y, z))
return false;
thing->angle = angle;
if (!dontstopmove)
thing->momx = thing->momy = thing->momz = 0;
else // Change speed to match direction
P_InstaThrust(thing, thing->angle, P_AproxDistance(thing->momx, thing->momy));
P_InstaThrust(thing, angle, FixedHypot(thing->momx, thing->momy));
if (thing->player)
{
@ -139,21 +137,6 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
else
thing->player->viewz = thing->z + thing->player->viewheight;
if (!dontstopmove)
thing->reactiontime = TICRATE/2; // don't move for about half a second
// absolute angle position
if (thing->player == &players[consoleplayer])
localangle = angle;
if (thing->player == &players[secondarydisplayplayer])
localangle2 = angle;
// move chasecam at new player location
if (splitscreen && camera2.chase && thing->player == &players[secondarydisplayplayer])
P_ResetCamera(thing->player, &camera2);
else if (camera.chase && thing->player == &players[displayplayer])
P_ResetCamera(thing->player, &camera);
// don't run in place after a teleport
if (!dontstopmove)
{
@ -171,11 +154,30 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
thing->player->speed = 0;
P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_PLAY_STND);
thing->reactiontime = TICRATE/2; // don't move for about half a second
thing->player->drawangle = angle;
}
else
thing->player->drawangle += (angle - thing->angle);
// absolute angle position
if (thing->player == &players[consoleplayer])
localangle = angle;
if (thing->player == &players[secondarydisplayplayer])
localangle2 = angle;
// move chasecam at new player location
if (splitscreen && camera2.chase && thing->player == &players[secondarydisplayplayer])
P_ResetCamera(thing->player, &camera2);
else if (camera.chase && thing->player == &players[displayplayer])
P_ResetCamera(thing->player, &camera);
if (flash)
P_FlashPal(thing->player, PAL_MIXUP, 10);
}
thing->angle = angle;
return true;
}

View file

@ -578,14 +578,14 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
{
CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle)));
Z_Free(lumpinfo);
free(zentry);
free(zentries);
return NULL;
}
if (memcmp(zentry->signature, pat_central, 4))
{
CONS_Alert(CONS_ERROR, "Central directory is corrupt\n");
Z_Free(lumpinfo);
free(zentry);
free(zentries);
return NULL;
}
@ -598,7 +598,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
{
CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle)));
Z_Free(lumpinfo);
free(zentry);
free(zentries);
free(fullname);
return NULL;
}
@ -640,6 +640,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
}
}
free(zentries);
*nlmp = numlumps;
return lumpinfo;
}
@ -1306,8 +1308,9 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
{
size = 0;
zerr(zErr);
(void)inflateEnd(&strm);
}
(void)inflateEnd(&strm);
}
else
{