Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into ffloor-experiments

This commit is contained in:
Jaime Passos 2020-07-22 23:31:10 -03:00
commit ccd095f1bf
6 changed files with 36 additions and 19 deletions

View file

@ -812,7 +812,7 @@ static void readskincolor(MYFILE *f, INT32 num)
deh_strlcpy(truncword, word2, namesize, va("Skincolor %d: name", num)); // truncate here to check for dupes
dupecheck = R_GetColorByName(truncword);
if (truncword[0] != '\0' && (!stricmp(truncword, skincolors[SKINCOLOR_NONE].name) || dupecheck && dupecheck != num))
if (truncword[0] != '\0' && (!stricmp(truncword, skincolors[SKINCOLOR_NONE].name) || (dupecheck && dupecheck != num)))
{
size_t lastchar = strlen(truncword);
char oldword[lastchar+1];

View file

@ -2382,9 +2382,12 @@ static void WriteDemoChecksum(void)
static void G_StopDemoRecording(void)
{
boolean saved = false;
WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker
WriteDemoChecksum();
saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file.
if (demo_p)
{
WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker
WriteDemoChecksum();
saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file.
}
free(demobuffer);
demorecording = false;

View file

@ -1113,6 +1113,16 @@ static int lib_pPlayerCanDamage(lua_State *L)
return 1;
}
static int lib_pPlayerFullbright(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
lua_pushboolean(L, P_PlayerFullbright(player));
return 1;
}
static int lib_pIsObjectInGoop(lua_State *L)
{
@ -3386,6 +3396,7 @@ static luaL_Reg lib[] = {
{"P_DoPlayerPain",lib_pDoPlayerPain},
{"P_ResetPlayer",lib_pResetPlayer},
{"P_PlayerCanDamage",lib_pPlayerCanDamage},
{"P_PlayerFullbright",lib_pPlayerFullbright},
{"P_IsObjectInGoop",lib_pIsObjectInGoop},
{"P_IsObjectOnGround",lib_pIsObjectOnGround},
{"P_InSpaceSector",lib_pInSpaceSector},

View file

@ -142,6 +142,7 @@ void P_SetPlayerAngle(player_t *player, angle_t angle);
angle_t P_GetLocalAngle(player_t *player);
void P_SetLocalAngle(player_t *player, angle_t angle);
void P_ForceLocalAngle(player_t *player, angle_t angle);
boolean P_PlayerFullbright(player_t *player);
boolean P_IsObjectInGoop(mobj_t *mo);
boolean P_IsObjectOnGround(mobj_t *mo);

View file

@ -442,7 +442,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
mobj->sprite2 = spr2;
mobj->frame = frame|(st->frame&~FF_FRAMEMASK);
if (player->powers[pw_super] || (player->powers[pw_carry] == CR_NIGHTSMODE && (player->charflags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER)) // Super colours? Super bright!
if (P_PlayerFullbright(player))
mobj->frame |= FF_FULLBRIGHT;
}
// Regular sprites

View file

@ -5536,7 +5536,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
if ((!(gametyperules & GTR_TEAMFLAGS) || !player->gotflag) && !player->exiting)
{
if (player->secondjump == 1 && player->charability != CA_DOUBLEJUMP)
if (player->secondjump == 1 && player->charability != CA_DOUBLEJUMP && player->charability != CA_THOK)
{
fixed_t potentialmomz;
if (player->charability == CA_SLOWFALL)
@ -7975,20 +7975,13 @@ void P_MovePlayer(player_t *player)
// Locate the capsule for this mare.
else if (maptol & TOL_NIGHTS)
{
if ((player->powers[pw_carry] == CR_NIGHTSMODE)
&& (player->exiting
|| !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
&& player->mo->state < &states[S_PLAY_NIGHTS_TRANS6]))) // Note the < instead of <=
if (P_PlayerFullbright(player))
{
skin_t *skin = ((skin_t *)(player->mo->skin));
if (( skin->flags & (SF_SUPER|SF_NONIGHTSSUPER) ) == SF_SUPER)
{
player->mo->color = skin->supercolor
+ ((player->nightstime == player->startedtime)
? 4
: abs((((signed)leveltime >> 1) % 9) - 4)); // This is where super flashing is handled.
G_GhostAddColor(GHC_SUPER);
}
player->mo->color = ((skin_t *)player->mo->skin)->supercolor
+ ((player->nightstime == player->startedtime)
? 4
: abs((((signed)leveltime >> 1) % 9) - 4)); // This is where super flashing is handled.
G_GhostAddColor(GHC_SUPER);
}
if (!player->capsule && !player->bonustime)
@ -12895,3 +12888,12 @@ void P_ForceLocalAngle(player_t *player, angle_t angle)
else if (player == &players[secondarydisplayplayer])
localangle2 = angle;
}
boolean P_PlayerFullbright(player_t *player)
{
return (player->powers[pw_super]
|| ((player->powers[pw_carry] == CR_NIGHTSMODE && (((skin_t *)player->mo->skin)->flags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER) // Super colours? Super bright!
&& (player->exiting
|| !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
&& player->mo->state < &states[S_PLAY_NIGHTS_TRANS6])))); // Note the < instead of <=
}