Merge branch 'master' into sal-cleanup

This commit is contained in:
TehRealSalt 2018-10-08 00:22:44 -04:00
commit 1bce22cf72
45 changed files with 682 additions and 610 deletions

View file

@ -16,7 +16,7 @@ boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}

View file

@ -154,9 +154,9 @@ static CV_PossibleValue_t menuhighlight_cons_t[] =
{V_GOLDMAP, "Always gold"}, {V_GOLDMAP, "Always gold"},
{V_LAVENDERMAP, "Always lavender"}, {V_LAVENDERMAP, "Always lavender"},
{V_TEAMAP, "Always tea-green"}, {V_TEAMAP, "Always tea-green"},
{V_STEELMAP, "Always steel"}, {V_STEELMAP, "Always steel-blue"},
{V_PINKMAP, "Always pink"}, {V_PINKMAP, "Always pink"},
{V_TEALMAP, "Always teal"}, {V_BROWNMAP, "Always brown"},
{V_PEACHMAP, "Always peach"}, {V_PEACHMAP, "Always peach"},
{0, NULL} {0, NULL}
}; };
@ -291,7 +291,7 @@ static void CONS_backcolor_Change(void)
// TODO: This could probably be improved somehow... // TODO: This could probably be improved somehow...
// These colormaps are 99% identical, with just a few changed bytes // These colormaps are 99% identical, with just a few changed bytes
UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
static void CON_SetupColormaps(void) static void CON_SetupColormaps(void)
{ {
@ -311,8 +311,8 @@ static void CON_SetupColormaps(void)
teamap = (goldmap+256); teamap = (goldmap+256);
steelmap = (teamap+256); steelmap = (teamap+256);
pinkmap = (steelmap+256); pinkmap = (steelmap+256);
tealmap = (pinkmap+256); brownmap = (pinkmap+256);
peachmap = (tealmap+256); peachmap = (brownmap+256);
// setup the other colormaps, for console text // setup the other colormaps, for console text
@ -335,8 +335,8 @@ static void CON_SetupColormaps(void)
goldmap[120] = (UINT8)114; goldmap[120] = (UINT8)114;
teamap[120] = (UINT8)177; teamap[120] = (UINT8)177;
steelmap[120] = (UINT8)201; steelmap[120] = (UINT8)201;
pinkmap[120] = (UINT8)124; pinkmap[120] = (UINT8)145;
tealmap[120] = (UINT8)220; brownmap[120] = (UINT8)48;
peachmap[120] = (UINT8)69; // nice peachmap[120] = (UINT8)69; // nice
// Init back colormap // Init back colormap

View file

@ -39,7 +39,7 @@ extern UINT32 con_scalefactor; // console text scale factor
extern consvar_t cons_backcolor, cons_menuhighlight; extern consvar_t cons_backcolor, cons_menuhighlight;
extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
// Console bg color (auto updated to match) // Console bg color (auto updated to match)
extern UINT8 *consolebgmap; extern UINT8 *consolebgmap;

View file

@ -2491,9 +2491,9 @@ static void CL_RemovePlayer(INT32 playernum)
LUA_InvalidatePlayer(&players[playernum]); LUA_InvalidatePlayer(&players[playernum]);
#endif #endif
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P /*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors(); P_CheckSurvivors();
else if (G_BattleGametype()) // SRB2Kart else*/ if (G_BattleGametype()) // SRB2Kart
K_CheckBumpers(); K_CheckBumpers();
else if (G_RaceGametype()) else if (G_RaceGametype())
P_CheckRacers(); P_CheckRacers();
@ -2920,7 +2920,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
} }
consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
#ifdef VANILLAJOINNEXTROUND
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
#endif
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}};
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}};
@ -2966,7 +2968,9 @@ void D_ClientServerInit(void)
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer); RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
#ifndef NONET #ifndef NONET
CV_RegisterVar(&cv_allownewplayer); CV_RegisterVar(&cv_allownewplayer);
#ifdef VANILLAJOINNEXTROUND
CV_RegisterVar(&cv_joinnextround); CV_RegisterVar(&cv_joinnextround);
#endif
CV_RegisterVar(&cv_showjoinaddress); CV_RegisterVar(&cv_showjoinaddress);
CV_RegisterVar(&cv_resynchattempts); CV_RegisterVar(&cv_resynchattempts);
CV_RegisterVar(&cv_blamecfail); CV_RegisterVar(&cv_blamecfail);
@ -3519,8 +3523,10 @@ static void HandleConnect(SINT8 node)
// you get a free second before desynch checks. use it wisely. // you get a free second before desynch checks. use it wisely.
SV_InitResynchVars(node); SV_InitResynchVars(node);
#ifdef VANILLAJOINNEXTROUND
if (cv_joinnextround.value && gameaction == ga_nothing) if (cv_joinnextround.value && gameaction == ga_nothing)
G_SetGamestate(GS_WAITINGPLAYERS); G_SetGamestate(GS_WAITINGPLAYERS);
#endif
if (!SV_SendServerConfig(node)) if (!SV_SendServerConfig(node))
{ {
G_SetGamestate(backupstate); G_SetGamestate(backupstate);

View file

@ -497,7 +497,11 @@ extern UINT32 realpingtable[MAXPLAYERS];
extern UINT32 playerpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS];
#endif #endif
extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; extern consvar_t
#ifdef VANILLAJOINNEXTROUND
cv_joinnextround,
#endif
cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
// Used in d_net, the only dependence // Used in d_net, the only dependence
tic_t ExpandTics(INT32 low); tic_t ExpandTics(INT32 low);

View file

@ -723,20 +723,6 @@ void D_SRB2Loop(void)
} }
else if (rendertimeout < entertic) // in case the server hang or netsplit else if (rendertimeout < entertic) // in case the server hang or netsplit
{ {
// Lagless camera! Yay!
/* Not yay, it ruins Kart's drift :y
if (gamestate == GS_LEVEL && netgame)
{
if (camera.chase)
P_MoveChaseCamera(&players[displayplayer], &camera, false);
if (splitscreen && camera2.chase)
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
if (splitscreen > 1 && camera3.chase)
P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false);
if (splitscreen > 2 && camera4.chase)
P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false);
}
*/
D_Display(); D_Display();
if (moviemode) if (moviemode)
@ -1484,6 +1470,29 @@ void D_SRB2Main(void)
} }
} }
if (M_CheckParm("-skill") && M_IsNextParm())
{
INT32 j;
INT16 newskill = -1;
const char *sskill = M_GetNextParm();
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill))
{
newskill = (INT16)kartspeed_cons_t[j].value;
break;
}
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
{
j = atoi(sskill); // assume they gave us a skill number, which is okay too
if (j >= 0 && j <= 2)
newskill = (INT16)j;
}
if (newskill != -1)
CV_SetValue(&cv_kartspeed, newskill);
}
if (server && !M_CheckParm("+map")) if (server && !M_CheckParm("+map"))
{ {
// Prevent warping to nonexistent levels // Prevent warping to nonexistent levels

View file

@ -915,19 +915,19 @@ void D_RegisterClientCommands(void)
COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("noclip", Command_CheatNoClip_f);
COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("god", Command_CheatGod_f);
COM_AddCommand("notarget", Command_CheatNoTarget_f); COM_AddCommand("notarget", Command_CheatNoTarget_f);
COM_AddCommand("getallemeralds", Command_Getallemeralds_f); /*COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setlives", Command_Setlives_f); COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f); COM_AddCommand("setcontinues", Command_Setcontinues_f);*/
COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("devmode", Command_Devmode_f);
COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f);
COM_AddCommand("scale", Command_Scale_f); COM_AddCommand("scale", Command_Scale_f);
COM_AddCommand("gravflip", Command_Gravflip_f); COM_AddCommand("gravflip", Command_Gravflip_f);
COM_AddCommand("hurtme", Command_Hurtme_f); COM_AddCommand("hurtme", Command_Hurtme_f);
COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); /*COM_AddCommand("jumptoaxis", Command_JumpToAxis_f);
COM_AddCommand("charability", Command_Charability_f); COM_AddCommand("charability", Command_Charability_f);
COM_AddCommand("charspeed", Command_Charspeed_f); COM_AddCommand("charspeed", Command_Charspeed_f);*/
COM_AddCommand("teleport", Command_Teleport_f); COM_AddCommand("teleport", Command_Teleport_f);
COM_AddCommand("rteleport", Command_RTeleport_f); COM_AddCommand("rteleport", Command_RTeleport_f);
COM_AddCommand("skynum", Command_Skynum_f); COM_AddCommand("skynum", Command_Skynum_f);
@ -3260,9 +3260,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
} }
// In tag, check to see if you still have a game. // In tag, check to see if you still have a game.
if (G_TagGametype()) /*if (G_TagGametype())
P_CheckSurvivors(); P_CheckSurvivors();
else if (G_BattleGametype()) else*/ if (G_BattleGametype())
K_CheckBumpers(); // SRB2Kart K_CheckBumpers(); // SRB2Kart
else if (G_RaceGametype()) else if (G_RaceGametype())
P_CheckRacers(); // also SRB2Kart P_CheckRacers(); // also SRB2Kart

View file

@ -1308,6 +1308,13 @@ static void readlevelheader(MYFILE *f, INT32 num)
else else
mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE; mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE;
} }
else if (fastcmp(word, "SECTIONRACE"))
{
if (i || word2[0] == 'T' || word2[0] == 'Y')
mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE;
else
mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE;
}
// Individual triggers for menu flags // Individual triggers for menu flags
else if (fastcmp(word, "HIDDEN")) else if (fastcmp(word, "HIDDEN"))
@ -7613,9 +7620,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SALMON", // 10 // SKINCOLOR_SALMON "SALMON", // 10 // SKINCOLOR_SALMON
"PINK", // 11 // SKINCOLOR_PINK "PINK", // 11 // SKINCOLOR_PINK
"ROSE", // 12 // SKINCOLOR_ROSE "ROSE", // 12 // SKINCOLOR_ROSE
"RASPBERRY", // 13 // SKINCOLOR_RASPBERRY "RUBY", // 13 // SKINCOLOR_RUBY
"RED", // 14 // SKINCOLOR_RED "RASPBERRY", // 14 // SKINCOLOR_RASPBERRY
"RUBY", // 15 // SKINCOLOR_RUBY "RED", // 15 // SKINCOLOR_RED
"CRIMSON", // 16 // SKINCOLOR_CRIMSON "CRIMSON", // 16 // SKINCOLOR_CRIMSON
"KETCHUP", // 17 // SKINCOLOR_KETCHUP "KETCHUP", // 17 // SKINCOLOR_KETCHUP
"DAWN", // 18 // SKINCOLOR_DAWN "DAWN", // 18 // SKINCOLOR_DAWN
@ -7635,16 +7642,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"VOMIT", // 32 // SKINCOLOR_VOMIT "VOMIT", // 32 // SKINCOLOR_VOMIT
"GARDEN", // 33 // SKINCOLOR_GARDEN "GARDEN", // 33 // SKINCOLOR_GARDEN
"LIME", // 34 // SKINCOLOR_LIME "LIME", // 34 // SKINCOLOR_LIME
"DREAM", // 35 // SKINCOLOR_DREAM "TEA", // 35 // SKINCOLOR_TEA
"TEA", // 36 // SKINCOLOR_TEA "PISTACHIO", // 36 // SKINCOLOR_PISTACHIO
"PISTACHIO", // 37 // SKINCOLOR_PISTACHIO "ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD
"ROBOHOOD", // 38 // SKINCOLOR_ROBOHOOD "MOSS", // 38 // SKINCOLOR_MOSS
"MOSS", // 39 // SKINCOLOR_MOSS "MINT", // 39 // SKINCOLOR_MINT
"MINT", // 40 // SKINCOLOR_MINT "GREEN", // 40 // SKINCOLOR_GREEN
"GREEN", // 41 // SKINCOLOR_GREEN "PINETREE", // 41 // SKINCOLOR_PINETREE
"PINETREE", // 42 // SKINCOLOR_PINETREE "EMERALD", // 42 // SKINCOLOR_EMERALD
"EMERALD", // 43 // SKINCOLOR_EMERALD "SWAMP", // 43 // SKINCOLOR_SWAMP
"SWAMP", // 44 // SKINCOLOR_SWAMP "DREAM", // 44 // SKINCOLOR_DREAM
"AQUA", // 45 // SKINCOLOR_AQUA "AQUA", // 45 // SKINCOLOR_AQUA
"TEAL", // 46 // SKINCOLOR_TEAL "TEAL", // 46 // SKINCOLOR_TEAL
"CYAN", // 47 // SKINCOLOR_CYAN "CYAN", // 47 // SKINCOLOR_CYAN
@ -7654,9 +7661,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SLATE", // 51 // SKINCOLOR_SLATE "SLATE", // 51 // SKINCOLOR_SLATE
"STEEL", // 52 // SKINCOLOR_STEEL "STEEL", // 52 // SKINCOLOR_STEEL
"JET", // 53 // SKINCOLOR_JET "JET", // 53 // SKINCOLOR_JET
"PERIWINKLE", // 54 // SKINCOLOR_PERIWINKLE "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE
"BLUE", // 55 // SKINCOLOR_BLUE "PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE
"SAPPHIRE", // 56 // SKINCOLOR_SAPPHIRE "BLUE", // 56 // SKINCOLOR_BLUE
"BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY
"DUSK", // 58 // SKINCOLOR_DUSK "DUSK", // 58 // SKINCOLOR_DUSK
"PURPLE", // 59 // SKINCOLOR_PURPLE "PURPLE", // 59 // SKINCOLOR_PURPLE
@ -7943,6 +7950,7 @@ struct {
{"LF_NOSSMUSIC",LF_NOSSMUSIC}, {"LF_NOSSMUSIC",LF_NOSSMUSIC},
{"LF_NORELOAD",LF_NORELOAD}, {"LF_NORELOAD",LF_NORELOAD},
{"LF_NOZONE",LF_NOZONE}, {"LF_NOZONE",LF_NOZONE},
{"LF_SECTIONRACE",LF_SECTIONRACE},
// And map flags // And map flags
{"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINMENU",LF2_HIDEINMENU},
{"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS},
@ -8264,7 +8272,7 @@ struct {
{"V_TEAMAP",V_TEAMAP}, {"V_TEAMAP",V_TEAMAP},
{"V_STEELMAP",V_STEELMAP}, {"V_STEELMAP",V_STEELMAP},
{"V_PINKMAP",V_PINKMAP}, {"V_PINKMAP",V_PINKMAP},
{"V_TEALMAP",V_TEALMAP}, {"V_BROWNMAP",V_BROWNMAP},
{"V_PEACHMAP",V_PEACHMAP}, {"V_PEACHMAP",V_PEACHMAP},
{"V_TRANSLUCENT",V_TRANSLUCENT}, {"V_TRANSLUCENT",V_TRANSLUCENT},
{"V_10TRANS",V_10TRANS}, {"V_10TRANS",V_10TRANS},

View file

@ -46,7 +46,7 @@ static void VID_Command_ModeInfo_f (void);
static void VID_Command_ModeList_f (void); static void VID_Command_ModeList_f (void);
static void VID_Command_Mode_f (void); static void VID_Command_Mode_f (void);
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#define VBEVERSION 2 // we need vesa2 or higher #define VBEVERSION 2 // we need vesa2 or higher
@ -92,8 +92,8 @@ static vmode_t *pcurrentmode; // the current active videomode.
// table des modes videos. // table des modes videos.
// seul le mode 320x200x256c standard VGA est support sans le VESA. // seul le mode 320x200x256c standard VGA est support<EFBFBD> sans le VESA.
// ce mode est le mode numro 0 dans la liste. // ce mode est le mode num<EFBFBD>ro 0 dans la liste.
typedef struct typedef struct
{ {
int modenum; // vesa vbe2.0 modenum int modenum; // vesa vbe2.0 modenum

View file

@ -244,9 +244,9 @@ typedef enum
SKINCOLOR_SALMON, SKINCOLOR_SALMON,
SKINCOLOR_PINK, SKINCOLOR_PINK,
SKINCOLOR_ROSE, SKINCOLOR_ROSE,
SKINCOLOR_RUBY,
SKINCOLOR_RASPBERRY, SKINCOLOR_RASPBERRY,
SKINCOLOR_RED, SKINCOLOR_RED,
SKINCOLOR_RUBY,
SKINCOLOR_CRIMSON, SKINCOLOR_CRIMSON,
SKINCOLOR_KETCHUP, SKINCOLOR_KETCHUP,
SKINCOLOR_DAWN, SKINCOLOR_DAWN,
@ -266,7 +266,6 @@ typedef enum
SKINCOLOR_VOMIT, SKINCOLOR_VOMIT,
SKINCOLOR_GARDEN, SKINCOLOR_GARDEN,
SKINCOLOR_LIME, SKINCOLOR_LIME,
SKINCOLOR_DREAM,
SKINCOLOR_TEA, SKINCOLOR_TEA,
SKINCOLOR_PISTACHIO, SKINCOLOR_PISTACHIO,
SKINCOLOR_ROBOHOOD, SKINCOLOR_ROBOHOOD,
@ -276,6 +275,7 @@ typedef enum
SKINCOLOR_PINETREE, SKINCOLOR_PINETREE,
SKINCOLOR_EMERALD, SKINCOLOR_EMERALD,
SKINCOLOR_SWAMP, SKINCOLOR_SWAMP,
SKINCOLOR_DREAM,
SKINCOLOR_AQUA, SKINCOLOR_AQUA,
SKINCOLOR_TEAL, SKINCOLOR_TEAL,
SKINCOLOR_CYAN, SKINCOLOR_CYAN,
@ -285,9 +285,9 @@ typedef enum
SKINCOLOR_SLATE, SKINCOLOR_SLATE,
SKINCOLOR_STEEL, SKINCOLOR_STEEL,
SKINCOLOR_JET, SKINCOLOR_JET,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_PERIWINKLE, SKINCOLOR_PERIWINKLE,
SKINCOLOR_BLUE, SKINCOLOR_BLUE,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave slender aphrodite has overcome me with longing for a girl
SKINCOLOR_BLUEBERRY, SKINCOLOR_BLUEBERRY,
SKINCOLOR_DUSK, SKINCOLOR_DUSK,
SKINCOLOR_PURPLE, SKINCOLOR_PURPLE,
@ -546,6 +546,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// SRB2Kart: Camera always has noclip. /// SRB2Kart: Camera always has noclip.
/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes.
//#define NOCLIPCAM #define NOCLIPCAM
#endif // __DOOMDEF__ #endif // __DOOMDEF__

View file

@ -272,6 +272,7 @@ typedef struct
#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music #define LF_NOSSMUSIC 4 ///< Disable Super Sonic music
#define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NORELOAD 8 ///< Don't reload level on death
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_NOZONE 16 ///< Don't include "ZONE" on level title
#define LF_SECTIONRACE 32 ///< Section race level
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen

View file

@ -8,7 +8,7 @@ boolean highcolor = false;
boolean allow_fullscreen = false; boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void){} void I_StartupGraphics(void){}

View file

@ -523,12 +523,15 @@ static const char *credits[] = {
"\"VirtAnderson\"", "\"VirtAnderson\"",
"", "",
"\1Special Thanks", "\1Special Thanks",
"Sonic Team Jr. & SRB2", "Sonic Team Jr. & SRB2 (www.srb2.org)",
"Bandit \"Bobby\" Cochenour", // i <3 my dog "Bandit \"Bobby\" Cochenour", // i <3 my dog
"Bear", // i <3 MY dog too
"\"Chrispy\"",
"\"DirkTheHusky\"",
"\"fickle\"", // and my sharki
"\"Nev3r\"", "\"Nev3r\"",
"\"Ritz\"", "\"Ritz\"",
"\"Spherallic\"", "\"Spherallic\"",
"\"DirkTheHusky\"",
"", "",
"\1Produced By", "\1Produced By",
"Kart Krew", "Kart Krew",
@ -554,7 +557,7 @@ static struct {
{112, 80+200* 7, "CREDIT10"}, {112, 80+200* 7, "CREDIT10"},
{240, 80+200* 8, "CREDIT05"}, {240, 80+200* 8, "CREDIT05"},
{120, 80+200* 9, "CREDIT06"},*/ {120, 80+200* 9, "CREDIT06"},*/
{112, 80+200*10, "TYLER52"}, {112, 80+100+200*10, "TYLER52"},
{0, 0, NULL} {0, 0, NULL}
}; };

View file

@ -2542,15 +2542,15 @@ void G_PlayerReborn(INT32 player)
p->maxlink = 0; p->maxlink = 0;
// If NiGHTS, find lowest mare to start with. // If NiGHTS, find lowest mare to start with.
p->mare = P_FindLowestMare(); p->mare = 0; /*P_FindLowestMare();
CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare); CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare);
if (p->mare == 255) if (p->mare == 255)
p->mare = 0; p->mare = 0;*/
// Check to make sure their color didn't change somehow... // Check to make sure their color didn't change somehow...
if (G_GametypeHasTeams()) /*if (G_GametypeHasTeams())
{ {
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam) if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
{ {
@ -2574,7 +2574,7 @@ void G_PlayerReborn(INT32 player)
else if (p == &players[fourthdisplayplayer]) else if (p == &players[fourthdisplayplayer])
CV_SetValue(&cv_playercolor4, skincolor_blueteam); CV_SetValue(&cv_playercolor4, skincolor_blueteam);
} }
} }*/
} }
// //
@ -2955,8 +2955,6 @@ void G_DoReborn(INT32 playernum)
P_LoadThingsOnly(); P_LoadThingsOnly();
P_ClearStarPost(player->starpostnum);
// Do a wipe // Do a wipe
wipegamestate = -1; wipegamestate = -1;

View file

@ -643,13 +643,13 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize;
angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT; angle = FOFsector->floorpic_angle;
} }
else // it's a ceiling else // it's a ceiling
{ {
scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize;
angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT; angle = FOFsector->ceilingpic_angle;
} }
} }
else if (gr_frontsector) else if (gr_frontsector)
@ -658,24 +658,26 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize;
angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT; angle = gr_frontsector->floorpic_angle;
} }
else // it's a ceiling else // it's a ceiling
{ {
scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize; scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize;
scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize;
angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT; angle = gr_frontsector->ceilingpic_angle;
} }
} }
if (angle) // Only needs to be done if there's an altered angle if (angle) // Only needs to be done if there's an altered angle
{ {
angle = InvAngle(angle)>>ANGLETOFINESHIFT;
// This needs to be done so that it scrolls in a different direction after rotation like software // This needs to be done so that it scrolls in a different direction after rotation like software
tempxsow = FLOAT_TO_FIXED(scrollx); /*tempxsow = FLOAT_TO_FIXED(scrollx);
tempytow = FLOAT_TO_FIXED(scrolly); tempytow = FLOAT_TO_FIXED(scrolly);
scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));*/
// This needs to be done so everything aligns after rotation // This needs to be done so everything aligns after rotation
// It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does // It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does
@ -689,7 +691,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
{ {
// Hurdler: add scrolling texture on floor/ceiling // Hurdler: add scrolling texture on floor/ceiling
v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx); v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx);
v3d->tow = (float)(flatyref - (pv->y / fflatsize) + scrolly); v3d->tow = (float)(-(pv->y / fflatsize) + flatyref + scrolly);
//v3d->sow = (float)(pv->x / fflatsize); //v3d->sow = (float)(pv->x / fflatsize);
//v3d->tow = (float)(pv->y / fflatsize); //v3d->tow = (float)(pv->y / fflatsize);
@ -700,7 +702,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
tempxsow = FLOAT_TO_FIXED(v3d->sow); tempxsow = FLOAT_TO_FIXED(v3d->sow);
tempytow = FLOAT_TO_FIXED(v3d->tow); tempytow = FLOAT_TO_FIXED(v3d->tow);
v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); v3d->tow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
} }
//v3d->sow = (float)(v3d->sow - flatxref + scrollx); //v3d->sow = (float)(v3d->sow - flatxref + scrollx);
@ -2811,12 +2813,15 @@ static void HWR_AddLine(seg_t * line)
SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
if (viewsector != gr_backsector && viewsector != gr_frontsector)
{
// Closed door. // Closed door.
if ((backc1 <= frontf1 && backc2 <= frontf2) if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2)) || (backf1 >= frontc1 && backf2 >= frontc2))
{ {
goto clipsolid; goto clipsolid;
} }
}
// Window. // Window.
if (backc1 != frontc1 || backc2 != frontc2 if (backc1 != frontc1 || backc2 != frontc2
@ -2827,11 +2832,14 @@ static void HWR_AddLine(seg_t * line)
} }
else else
#endif #endif
{
if (viewsector != gr_backsector && viewsector != gr_frontsector)
{ {
// Closed door. // Closed door.
if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || if (gr_backsector->ceilingheight <= gr_frontsector->floorheight ||
gr_backsector->floorheight >= gr_frontsector->ceilingheight) gr_backsector->floorheight >= gr_frontsector->ceilingheight)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight ||

View file

@ -435,7 +435,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
numwords = COM_Argc() - usedargs; numwords = COM_Argc() - usedargs;
I_Assert(numwords > 0); I_Assert(numwords > 0);
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // TODO: Per Player mute. if (CHAT_MUTE) // TODO: Per Player mute.
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"));
return; return;
@ -568,7 +568,10 @@ static void Command_Sayteam_f(void)
return; return;
} }
if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype.
DoSayCommand(-1, 1, 0); DoSayCommand(-1, 1, 0);
else
DoSayCommand(0, 1, 0);
} }
/** Send a message to everyone, to be displayed by CECHO. Only /** Send a message to everyone, to be displayed by CECHO. Only
@ -722,15 +725,28 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x86"; // grey name cstart = "\x86"; // grey name
textcolor = "\x86"; textcolor = "\x86";
} }
else if (target == -1) // say team
{
if (players[playernum].ctfteam == 1) // red
{
cstart = "\x85";
textcolor = "\x85";
}
else // blue
{
cstart = "\x84";
textcolor = "\x84";
}
}
else else
{ {
const UINT8 color = players[playernum].skincolor; const UINT8 color = players[playernum].skincolor;
if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE) if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE)
cstart = "\x80"; // white cstart = "\x80"; // white
else if (color <= SKINCOLOR_BEIGE || color == SKINCOLOR_JET) else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET)
cstart = "\x86"; // V_GRAYMAP cstart = "\x86"; // V_GRAYMAP
else if (color <= SKINCOLOR_LEATHER) else if (color <= SKINCOLOR_LEATHER)
cstart = "\x8A"; // V_GOLDMAP cstart = "\x8e"; // V_BROWNMAP
else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC) else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC)
cstart = "\x8d"; // V_PINKMAP cstart = "\x8d"; // V_PINKMAP
else if (color <= SKINCOLOR_KETCHUP) else if (color <= SKINCOLOR_KETCHUP)
@ -741,14 +757,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x8f"; // V_PEACHMAP cstart = "\x8f"; // V_PEACHMAP
else if (color <= SKINCOLOR_BRONZE) else if (color <= SKINCOLOR_BRONZE)
cstart = "\x8A"; // V_GOLDMAP cstart = "\x8A"; // V_GOLDMAP
else if (color <= SKINCOLOR_MUSTARD) else if (color <= SKINCOLOR_OLIVE)
cstart = "\x82"; // V_YELLOWMAP cstart = "\x82"; // V_YELLOWMAP
else if (color <= SKINCOLOR_PISTACHIO) else if (color <= SKINCOLOR_PISTACHIO)
cstart = "\x8b"; // V_TEAMAP cstart = "\x8b"; // V_TEAMAP
else if (color <= SKINCOLOR_SWAMP || color == SKINCOLOR_LIME) else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME)
cstart = "\x83"; // V_GREENMAP cstart = "\x83"; // V_GREENMAP
else if (color <= SKINCOLOR_TEAL)
cstart = "\x8e"; // V_TEALMAP
else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE)
cstart = "\x88"; // V_SKYMAP cstart = "\x88"; // V_SKYMAP
else if (color <= SKINCOLOR_STEEL) else if (color <= SKINCOLOR_STEEL)
@ -783,13 +797,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// '\4' makes the message yellow and beeps; '\3' just beeps. // '\4' makes the message yellow and beeps; '\3' just beeps.
if (action) if (action)
{ {
fmt = "\3* %s%s%s%s \x82%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! fmt = "\3* %s%s%s%s \x82%s%s\n"; // don't make /me yellow, yellow will be for mentions and PMs!
fmt2 = "* %s%s%s%s \x82%s"; fmt2 = "* %s%s%s%s \x82%s%s";
}
else if (target == 0) // To everyone
{
fmt = "\3%s<%s%s%s>\x80 %s%s\n";
fmt2 = "%s<%s%s%s>\x80 %s%s";
} }
else if (target-1 == consoleplayer) // To you else if (target-1 == consoleplayer) // To you
{ {
@ -809,7 +818,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
fmt2 = "%s<%s%s>%s\x80 %s%s"; fmt2 = "%s<%s%s>%s\x80 %s%s";
} }
else // To your team else // To everyone or sayteam, it doesn't change anything.
{
fmt = "\3%s<%s%s%s>\x80 %s%s\n";
fmt2 = "%s<%s%s%s>\x80 %s%s";
}
/*else // To your team
{ {
if (players[playernum].ctfteam == 1) // red if (players[playernum].ctfteam == 1) // red
prefix = "\x85[TEAM]"; prefix = "\x85[TEAM]";
@ -820,8 +834,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
fmt = "\3%s<%s%s>\x80%s %s%s\n"; fmt = "\3%s<%s%s>\x80%s %s%s\n";
fmt2 = "%s<%s%s>\x80%s %s%s"; fmt2 = "%s<%s%s>\x80%s %s%s";
}*/
}
HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type. HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type.
@ -950,7 +963,7 @@ static void HU_queueChatChar(INT32 c)
c_input = 0; c_input = 0;
// last minute mute check // last minute mute check
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) if (CHAT_MUTE)
{ {
HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85"));
return; return;
@ -1053,10 +1066,8 @@ boolean HU_Responder(event_t *ev)
{ {
// enter chat mode // enter chat mode
if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1])
&& netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise.
{ {
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
return false;
chat_on = true; chat_on = true;
w_chat[0] = 0; w_chat[0] = 0;
teamtalk = false; teamtalk = false;
@ -1064,13 +1075,11 @@ boolean HU_Responder(event_t *ev)
return true; return true;
} }
if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1])
&& netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) && netgame && !OLD_MUTE)
{ {
if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer)))
return false;
chat_on = true; chat_on = true;
w_chat[0] = 0; w_chat[0] = 0;
teamtalk = true; teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams.
chat_scrollmedown = true; chat_scrollmedown = true;
return true; return true;
} }
@ -1105,7 +1114,7 @@ boolean HU_Responder(event_t *ev)
// TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up. // TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up.
// pasting. pasting is cool. chat is a bit limited, though :( // pasting. pasting is cool. chat is a bit limited, though :(
if ((c == 'v' || c == 'V') && ctrldown) if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
{ {
const char *paste = I_ClipboardPaste(); const char *paste = I_ClipboardPaste();
@ -1145,7 +1154,7 @@ boolean HU_Responder(event_t *ev)
} }
} }
if (HU_keyInChatString(w_chat,c)) if (!CHAT_MUTE && HU_keyInChatString(w_chat,c))
{ {
HU_queueChatChar(c); HU_queueChatChar(c);
} }
@ -1163,21 +1172,21 @@ boolean HU_Responder(event_t *ev)
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
} }
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0) // CHAT SCROLLING YAYS! else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
{ {
chat_scroll--; chat_scroll--;
justscrolledup = true; justscrolledup = true;
chat_scrolltime = 4; chat_scrolltime = 4;
} }
else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0) else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0 && !OLDCHAT)
{ {
chat_scroll++; chat_scroll++;
justscrolleddown = true; justscrolleddown = true;
chat_scrolltime = 4; chat_scrolltime = 4;
} }
else if (c == KEY_LEFTARROW && c_input != 0) // i said go back else if (c == KEY_LEFTARROW && c_input != 0 && !OLDCHAT) // i said go back
c_input--; c_input--;
else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat)) else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat) && !OLDCHAT) // don't need to check for admin or w/e here since the chat won't ever contain anything if it's muted.
c_input++; c_input++;
return true; return true;
} }
@ -1488,8 +1497,10 @@ static void HU_DrawChat(void)
INT32 charwidth = 4, charheight = 6; INT32 charwidth = 4, charheight = 6;
INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0); INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0);
UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday! UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday!
INT32 cflag = 0;
const char *ntalk = "Say: ", *ttalk = "Team: "; const char *ntalk = "Say: ", *ttalk = "Team: ";
const char *talk = ntalk; const char *talk = ntalk;
const char *mute = "Chat has been muted.";
if (teamtalk) if (teamtalk)
{ {
@ -1502,6 +1513,13 @@ static void HU_DrawChat(void)
#endif #endif
} }
if (CHAT_MUTE)
{
talk = mute;
typelines = 1;
cflag = V_GRAYMAP; // set text in gray if chat is muted.
}
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
while (talk[i]) while (talk[i])
@ -1509,11 +1527,21 @@ static void HU_DrawChat(void)
if (talk[i] < HU_FONTSTART) if (talk[i] < HU_FONTSTART)
++i; ++i;
else else
V_DrawChatCharacter(chatx + c + 2, y, talk[i++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT, !cv_allcaps.value, NULL); {
V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag));
i++;
}
c += charwidth; c += charwidth;
} }
// if chat is muted, just draw the log and get it over with:
if (CHAT_MUTE)
{
HU_drawChatLog(0);
return;
}
i = 0; i = 0;
typelines = 1; typelines = 1;
@ -1957,12 +1985,15 @@ void HU_Drawer(void)
HU_DrawChat_Old(); // why the fuck......................... HU_DrawChat_Old(); // why the fuck.........................
} }
else else
{
if (netgame) // Don't draw it outside, I know it leads to stupid stuff.
{ {
chat_scrolltime = 0; // do scroll anyway. chat_scrolltime = 0; // do scroll anyway.
typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time.
if (!OLDCHAT) if (!OLDCHAT)
HU_drawMiniChat(); // draw messages in a cool fashion. HU_drawMiniChat(); // draw messages in a cool fashion.
} }
}
if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh) if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh)
{ {
@ -2229,22 +2260,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
if (G_RaceGametype()) if (G_RaceGametype())
{ {
#define timestring(time) va("%i:%02i.%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) #define timestring(time) va("%i'%02i\"%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time))
if (players[tab[i].num].exiting) if (players[tab[i].num].exiting)
{
V_DrawRightAlignedString(x, y-4, hilicol, "FIN");
V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime)); V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime));
}
else if (players[tab[i].num].pflags & PF_TIMEOVER) else if (players[tab[i].num].pflags & PF_TIMEOVER)
V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "TIME OVER..."); V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST.");
else if (circuitmap) else if (circuitmap)
{ V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count));
V_DrawRightAlignedString(x, y-4, 0, "Lap");
V_DrawRightAlignedString(x, y+4, 0, va("%d", tab[i].count));
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(players[tab[i].num].starposttime));
}
else
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(tab[i].count));
#undef timestring #undef timestring
} }
else else

View file

@ -81,6 +81,8 @@ extern patch_t *iconprefix[MAXSKINS];
#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
#define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640) #define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640)
#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot.
#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.
// some functions // some functions
void HU_AddChatText(const char *text); void HU_AddChatText(const char *text);

View file

@ -55,9 +55,9 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Salmon", // 10 // SKINCOLOR_SALMON "Salmon", // 10 // SKINCOLOR_SALMON
"Pink", // 11 // SKINCOLOR_PINK "Pink", // 11 // SKINCOLOR_PINK
"Rose", // 12 // SKINCOLOR_ROSE "Rose", // 12 // SKINCOLOR_ROSE
"Raspberry", // 13 // SKINCOLOR_RASPBERRY "Ruby", // 13 // SKINCOLOR_RUBY
"Red", // 14 // SKINCOLOR_RED "Raspberry", // 14 // SKINCOLOR_RASPBERRY
"Ruby", // 15 // SKINCOLOR_RUBY "Red", // 15 // SKINCOLOR_RED
"Crimson", // 16 // SKINCOLOR_CRIMSON "Crimson", // 16 // SKINCOLOR_CRIMSON
"Ketchup", // 17 // SKINCOLOR_KETCHUP "Ketchup", // 17 // SKINCOLOR_KETCHUP
"Dawn", // 18 // SKINCOLOR_DAWN "Dawn", // 18 // SKINCOLOR_DAWN
@ -77,16 +77,16 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Vomit", // 32 // SKINCOLOR_VOMIT "Vomit", // 32 // SKINCOLOR_VOMIT
"Garden", // 33 // SKINCOLOR_GARDEN "Garden", // 33 // SKINCOLOR_GARDEN
"Lime", // 34 // SKINCOLOR_LIME "Lime", // 34 // SKINCOLOR_LIME
"Dream", // 35 // SKINCOLOR_DREAM "Tea", // 35 // SKINCOLOR_TEA
"Tea", // 36 // SKINCOLOR_TEA "Pistachio", // 36 // SKINCOLOR_PISTACHIO
"Pistachio", // 37 // SKINCOLOR_PISTACHIO "Robo-Hood", // 37 // SKINCOLOR_ROBOHOOD
"Robo-Hood", // 38 // SKINCOLOR_ROBOHOOD "Moss", // 38 // SKINCOLOR_MOSS
"Moss", // 39 // SKINCOLOR_MOSS "Mint", // 39 // SKINCOLOR_MINT
"Mint", // 40 // SKINCOLOR_MINT "Green", // 40 // SKINCOLOR_GREEN
"Green", // 41 // SKINCOLOR_GREEN "Pinetree", // 41 // SKINCOLOR_PINETREE
"Pinetree", // 42 // SKINCOLOR_PINETREE "Emerald", // 42 // SKINCOLOR_EMERALD
"Emerald", // 43 // SKINCOLOR_EMERALD "Swamp", // 43 // SKINCOLOR_SWAMP
"Swamp", // 44 // SKINCOLOR_SWAMP "Dream", // 44 // SKINCOLOR_DREAM
"Aqua", // 45 // SKINCOLOR_AQUA "Aqua", // 45 // SKINCOLOR_AQUA
"Teal", // 46 // SKINCOLOR_TEAL "Teal", // 46 // SKINCOLOR_TEAL
"Cyan", // 47 // SKINCOLOR_CYAN "Cyan", // 47 // SKINCOLOR_CYAN
@ -96,9 +96,9 @@ const char *KartColor_Names[MAXSKINCOLORS] =
"Slate", // 51 // SKINCOLOR_SLATE "Slate", // 51 // SKINCOLOR_SLATE
"Steel", // 52 // SKINCOLOR_STEEL "Steel", // 52 // SKINCOLOR_STEEL
"Jet", // 53 // SKINCOLOR_JET "Jet", // 53 // SKINCOLOR_JET
"Periwinkle", // 54 // SKINCOLOR_PERIWINKLE "Sapphire", // 54 // SKINCOLOR_SAPPHIRE
"Blue", // 55 // SKINCOLOR_BLUE "Periwinkle", // 55 // SKINCOLOR_PERIWINKLE
"Sapphire", // 56 // SKINCOLOR_SAPPHIRE "Blue", // 56 // SKINCOLOR_BLUE
"Blueberry", // 57 // SKINCOLOR_BLUEBERRY "Blueberry", // 57 // SKINCOLOR_BLUEBERRY
"Dusk", // 58 // SKINCOLOR_DUSK "Dusk", // 58 // SKINCOLOR_DUSK
"Purple", // 59 // SKINCOLOR_PURPLE "Purple", // 59 // SKINCOLOR_PURPLE
@ -124,9 +124,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON
SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK
SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE
SKINCOLOR_MINT,8, // 13 // SKINCOLOR_RASPBERRY SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY
SKINCOLOR_GREEN,6, // 14 // SKINCOLOR_RED SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY
SKINCOLOR_SAPPHIRE,8, // 15 // SKINCOLOR_RUBY SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED
SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON
SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP
SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN
@ -146,16 +146,16 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT
SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN
SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME
SKINCOLOR_POMEGRANATE,8, // 35 // SKINCOLOR_DREAM SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA
SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO
SKINCOLOR_PINK,6, // 37 // SKINCOLOR_PISTACHIO SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD
SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS
SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT
SKINCOLOR_RASPBERRY,8, // 40 // SKINCOLOR_MINT SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN
SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE
SKINCOLOR_CRIMSON,8, // 42 // SKINCOLOR_PINETREE SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD
SKINCOLOR_PURPLE,8, // 43 // SKINCOLOR_EMERALD SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP
SKINCOLOR_BYZANTIUM,8, // 44 // SKINCOLOR_SWAMP SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM
SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA
SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL
SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN
@ -165,9 +165,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE
SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL
SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET
SKINCOLOR_CREAMSICLE,8, // 54 // SKINCOLOR_PERIWINKLE SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE
SKINCOLOR_ORANGE,8, // 55 // SKINCOLOR_BLUE SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE
SKINCOLOR_RUBY,6, // 56 // SKINCOLOR_SAPPHIRE SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE
SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY
SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK
SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE
@ -189,11 +189,11 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN
{ 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER
{120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON
{121, 121, 144, 144, 145, 145, 146, 146, 147, 148, 149, 150, 151, 134, 136, 138}, // SKINCOLOR_PINK {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK
{144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE
{121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY
{120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY
{125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED
{121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY
{130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON
{104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP
{120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN
@ -213,7 +213,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT
{ 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN
{ 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME
{120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM
{120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA
{120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO
{176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD
@ -223,18 +222,19 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = {
{160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE
{160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD
{186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP
{120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM
{120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA
{210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL
{120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN
{120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ {120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ
{208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN
{215, 215, 215, 216, 216, 217, 218, 204, 204, 205, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NAVY {211, 212, 213, 215, 216, 218, 219, 205, 206, 206, 207, 207, 28, 29, 30, 31}, // SKINCOLOR_NAVY
{120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE
{120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL
{200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET
{208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE
{120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE
{224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE
{208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE
{228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY
{192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK
{192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE
@ -1268,7 +1268,7 @@ static void K_SpawnDashDustRelease(player_t *player)
if (!P_IsObjectOnGround(player->mo)) if (!P_IsObjectOnGround(player->mo))
return; return;
if (player->speed == 0) if (!player->speed && !player->kartstuff[k_startboost])
return; return;
travelangle = player->mo->angle; travelangle = player->mo->angle;
@ -2985,7 +2985,7 @@ static void K_DoShrink(player_t *player)
} }
} }
static void K_DoSPB(player_t *victim, player_t *source) static void K_DoSPB(player_t *victim)
{ {
//INT32 i; //INT32 i;
S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG! S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG!
@ -2996,11 +2996,28 @@ static void K_DoSPB(player_t *victim, player_t *source)
P_FlashPal(&players[i], PAL_NUKE, 10); P_FlashPal(&players[i], PAL_NUKE, 10);
}*/ }*/
if (victim->mo && !victim->spectator) if (!victim->mo || !victim->mo->health || victim->spectator)
P_DamageMobj(victim->mo, source->mo, source->mo, 65); return;
{
mobj_t *spbexplode;
if (!victim->kartstuff[k_invincibilitytimer] && !victim->kartstuff[k_growshrinktimer])
{
K_DropHnextList(victim);
K_StripItems(victim);
victim->powers[pw_flashing] = 0;
}
spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION);
if (playeringame[spbplayer] && !players[spbplayer].spectator && players[spbplayer].mo)
P_SetTarget(&spbexplode->target, players[spbplayer].mo);
}
} }
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
{ {
const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale);
@ -3052,8 +3069,8 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
else else
mo->momz = FixedMul(vertispeed, vscale); mo->momz = FixedMul(vertispeed, vscale);
if (!mute) if (sound)
S_StartSound(mo, sfx_kpogos); S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos));
} }
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
@ -3109,7 +3126,7 @@ void K_DropHnextList(player_t *player)
mobj_t *work = player->mo, *nextwork, *dropwork; mobj_t *work = player->mo, *nextwork, *dropwork;
INT32 flip; INT32 flip;
mobjtype_t type; mobjtype_t type;
boolean orbit, ponground; boolean orbit, ponground, dropall = true;
if (!work) if (!work)
return; return;
@ -3149,6 +3166,7 @@ void K_DropHnextList(player_t *player)
break; break;
case MT_SSMINE_SHIELD: case MT_SSMINE_SHIELD:
orbit = false; orbit = false;
dropall = false;
type = MT_SSMINE; type = MT_SSMINE;
break; break;
case MT_FAKESHIELD: case MT_FAKESHIELD:
@ -3227,7 +3245,8 @@ void K_DropHnextList(player_t *player)
player->kartstuff[k_bananadrag] = 0; player->kartstuff[k_bananadrag] = 0;
if (player->kartstuff[k_eggmanheld]) if (player->kartstuff[k_eggmanheld])
player->kartstuff[k_eggmanheld] = 0; player->kartstuff[k_eggmanheld] = 0;
else if (player->kartstuff[k_itemheld]) else if (player->kartstuff[k_itemheld]
&& (dropall || (--player->kartstuff[k_itemamount] <= 0)))
{ {
player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0; player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0;
player->kartstuff[k_itemtype] = KITEM_NONE; player->kartstuff[k_itemtype] = KITEM_NONE;
@ -3789,7 +3808,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_deathsentence]) if (player->kartstuff[k_deathsentence])
{ {
if (player->kartstuff[k_deathsentence] == 1) if (player->kartstuff[k_deathsentence] == 1)
K_DoSPB(player, &players[spbplayer]); K_DoSPB(player);
player->kartstuff[k_deathsentence]--; player->kartstuff[k_deathsentence]--;
} }
@ -4082,6 +4101,7 @@ static void K_KartDrift(player_t *player, boolean onground)
&& (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo) && (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo)
&& onground) && onground)
{ {
if (player->kartstuff[k_driftboost] < 20)
player->kartstuff[k_driftboost] = 20; player->kartstuff[k_driftboost] = 20;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
@ -4092,6 +4112,7 @@ static void K_KartDrift(player_t *player, boolean onground)
&& player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge] < dsthree
&& onground) && onground)
{ {
if (player->kartstuff[k_driftboost] < 50)
player->kartstuff[k_driftboost] = 50; player->kartstuff[k_driftboost] = 50;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
@ -4102,6 +4123,7 @@ static void K_KartDrift(player_t *player, boolean onground)
&& player->kartstuff[k_driftcharge] >= dsthree && player->kartstuff[k_driftcharge] >= dsthree
&& onground) && onground)
{ {
if (player->kartstuff[k_driftboost] < 125)
player->kartstuff[k_driftboost] = 125; player->kartstuff[k_driftboost] = 125;
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
@ -4735,7 +4757,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
&& !player->kartstuff[k_pogospring]) && !player->kartstuff[k_pogospring])
{ {
K_PlayBoostTaunt(player->mo); K_PlayBoostTaunt(player->mo);
K_DoPogoSpring(player->mo, 32<<FRACBITS, false); K_DoPogoSpring(player->mo, 32<<FRACBITS, 2);
player->kartstuff[k_pogospring] = 1; player->kartstuff[k_pogospring] = 1;
player->kartstuff[k_itemamount]--; player->kartstuff[k_itemamount]--;
} }
@ -5886,7 +5908,7 @@ static void K_drawKartItem(void)
// Quick Eggman numbers // Quick Eggman numbers
if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/)
V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); V_DrawScaledPatch(ITEM_X+17-offset, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]);
} }
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing)

View file

@ -37,7 +37,7 @@ void K_SpawnSparkleTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
void K_DriftDustHandling(mobj_t *spawner); void K_DriftDustHandling(mobj_t *spawner);
void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoSneaker(player_t *player, boolean doPFlag);
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound);
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
void K_UpdateHnextList(player_t *player, boolean clean); void K_UpdateHnextList(player_t *player, boolean clean);
void K_DropHnextList(player_t *player); void K_DropHnextList(player_t *player);

View file

@ -2231,11 +2231,11 @@ static int lib_kDoPogoSpring(lua_State *L)
{ {
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t vertispeed = luaL_checkfixed(L, 2); fixed_t vertispeed = luaL_checkfixed(L, 2);
boolean mute = luaL_checkboolean(L, 3); UINT8 sound = luaL_checkinteger(L, 3);
NOHUD NOHUD
if (!mo) if (!mo)
return LUA_ErrInvalid(L, "mobj_t"); return LUA_ErrInvalid(L, "mobj_t");
K_DoPogoSpring(mo, vertispeed, mute); K_DoPogoSpring(mo, vertispeed, sound);
return 0; return 0;
} }

View file

@ -377,7 +377,7 @@ void Command_Hurtme_f(void)
} }
// Moves the NiGHTS player to another axis within the current mare // Moves the NiGHTS player to another axis within the current mare
void Command_JumpToAxis_f(void) /*void Command_JumpToAxis_f(void)
{ {
REQUIRE_DEVMODE; REQUIRE_DEVMODE;
REQUIRE_INLEVEL; REQUIRE_INLEVEL;
@ -438,7 +438,7 @@ void Command_Charspeed_f(void)
players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS; players[consoleplayer].actionspd = atoi(COM_Argv(2))<<FRACBITS;
else else
CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n")); CONS_Printf(M_GetText("charspeed <normalspeed/runspeed/thrustfactor/accelstart/acceleration/actionspd> <value>: set character speed\n"));
} }*/
void Command_RTeleport_f(void) void Command_RTeleport_f(void)
{ {
@ -683,7 +683,7 @@ void Command_Savecheckpoint_f(void)
} }
// Like M_GetAllEmeralds() but for console devmode junkies. // Like M_GetAllEmeralds() but for console devmode junkies.
void Command_Getallemeralds_f(void) /*void Command_Getallemeralds_f(void)
{ {
REQUIRE_SINGLEPLAYER; REQUIRE_SINGLEPLAYER;
REQUIRE_NOULTIMATE; REQUIRE_NOULTIMATE;
@ -702,7 +702,7 @@ void Command_Resetemeralds_f(void)
emeralds = 0; emeralds = 0;
CONS_Printf(M_GetText("Emeralds reset to zero.\n")); CONS_Printf(M_GetText("Emeralds reset to zero.\n"));
} }*/
void Command_Devmode_f(void) void Command_Devmode_f(void)
{ {
@ -730,7 +730,7 @@ void Command_Devmode_f(void)
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);
} }
void Command_Setrings_f(void) /*void Command_Setrings_f(void)
{ {
REQUIRE_INLEVEL; REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER; REQUIRE_SINGLEPLAYER;
@ -785,7 +785,7 @@ void Command_Setcontinues_f(void)
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);
} }
} }*/
// //
// OBJECTPLACE (and related variables) // OBJECTPLACE (and related variables)

View file

@ -48,18 +48,18 @@ void Command_CheatNoClip_f(void);
void Command_CheatGod_f(void); void Command_CheatGod_f(void);
void Command_CheatNoTarget_f(void); void Command_CheatNoTarget_f(void);
void Command_Savecheckpoint_f(void); void Command_Savecheckpoint_f(void);
void Command_Getallemeralds_f(void); /*void Command_Getallemeralds_f(void);
void Command_Resetemeralds_f(void); void Command_Resetemeralds_f(void);
void Command_Setrings_f(void); void Command_Setrings_f(void);
void Command_Setlives_f(void); void Command_Setlives_f(void);
void Command_Setcontinues_f(void); void Command_Setcontinues_f(void);*/
void Command_Devmode_f(void); void Command_Devmode_f(void);
void Command_Scale_f(void); void Command_Scale_f(void);
void Command_Gravflip_f(void); void Command_Gravflip_f(void);
void Command_Hurtme_f(void); void Command_Hurtme_f(void);
void Command_JumpToAxis_f(void); /*void Command_JumpToAxis_f(void);
void Command_Charability_f(void); void Command_Charability_f(void);
void Command_Charspeed_f(void); void Command_Charspeed_f(void);*/
void Command_Teleport_f(void); void Command_Teleport_f(void);
void Command_RTeleport_f(void); void Command_RTeleport_f(void);
void Command_Skynum_f(void); void Command_Skynum_f(void);

View file

@ -662,7 +662,8 @@ static menuitem_t MISC_HelpMenu[] =
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 0}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 1},
{IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL99", M_HandleImageDef, 0},
}; };
// -------------------------------- // --------------------------------
@ -1494,7 +1495,9 @@ static menuitem_t OP_ServerOptionsMenu[] =
#ifndef NONET #ifndef NONET
{IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90},
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100},
//{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, #ifdef VANILLAJOINNEXTROUND
{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110},
#endif
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110}, {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110},
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120}, {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120},
@ -4207,7 +4210,7 @@ static void M_DrawImageDef(void)
else else
{ {
patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE);
if (patch->width <= BASEVIDWIDTH) if (patch->height <= BASEVIDHEIGHT)
V_DrawScaledPatch(0,0,0,patch); V_DrawScaledPatch(0,0,0,patch);
else else
V_DrawSmallScaledPatch(0,0,0,patch); V_DrawSmallScaledPatch(0,0,0,patch);

View file

@ -32,7 +32,7 @@ boolean highcolor = false;
boolean allow_fullscreen = false; boolean allow_fullscreen = false;
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
void I_StartupGraphics(void) void I_StartupGraphics(void)
{ {

View file

@ -3913,15 +3913,25 @@ void A_ThrownRing(mobj_t *actor)
//{ SRB2kart - A_GRENADERING //{ SRB2kart - A_GRENADERING
static mobj_t *grenade; static mobj_t *grenade;
static fixed_t explodedist;
static inline boolean PIT_GrenadeRing(mobj_t *thing) static inline boolean PIT_GrenadeRing(mobj_t *thing)
{ {
if (!grenade) if (!grenade)
return true; return false;
if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player. if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player.
return true; return true;
if (!(thing->flags & MF_SHOOTABLE))
{
// didn't do any damage
return true;
}
if (netgame && thing->player && thing->player->spectator)
return true;
if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner. if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner.
return true; return true;
@ -3935,22 +3945,13 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
return true; return true;
// see if it went over / under // see if it went over / under
if (grenade->z - grenade->info->painchance > thing->z + thing->height) if (grenade->z - explodedist > thing->z + thing->height)
return true; // overhead return true; // overhead
if (grenade->z + grenade->height + grenade->info->painchance < thing->z) if (grenade->z + grenade->height + explodedist < thing->z)
return true; // underneath return true; // underneath
if (netgame && thing->player && thing->player->spectator)
return true;
if (!(thing->flags & MF_SHOOTABLE))
{
// didn't do any damage
return true;
}
if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y),
thing->z - grenade->z) > grenade->info->painchance) thing->z - grenade->z) > explodedist)
return true; // Too far away return true; // Too far away
// Explode! // Explode!
@ -3961,7 +3962,11 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
void A_GrenadeRing(mobj_t *actor) void A_GrenadeRing(mobj_t *actor)
{ {
INT32 bx, by, xl, xh, yl, yh; INT32 bx, by, xl, xh, yl, yh;
const fixed_t explodedist = actor->info->painchance; explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
#ifdef HAVE_BLUA
if (LUA_CallAction("A_GrenadeRing", actor))
return;
#endif
if (leveltime % 35 == 0) if (leveltime % 35 == 0)
S_StartSound(actor, actor->info->activesound); S_StartSound(actor, actor->info->activesound);
@ -3978,6 +3983,80 @@ void A_GrenadeRing(mobj_t *actor)
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
P_BlockThingsIterator(bx, by, PIT_GrenadeRing); P_BlockThingsIterator(bx, by, PIT_GrenadeRing);
} }
static inline boolean PIT_MineExplode(mobj_t *thing)
{
if (!grenade || P_MobjWasRemoved(grenade))
return false; // There's the possibility these can chain react onto themselves after they've already died if there are enough all in one spot
if (thing == grenade || thing->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
return true;
if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY))
return true;
if (netgame && thing->player && thing->player->spectator)
return true;
if (G_BattleGametype() && grenade->target && grenade->target->player && grenade->target->player->kartstuff[k_bumper] <= 0 && thing == grenade->target)
return true;
// see if it went over / under
if (grenade->z - explodedist > thing->z + thing->height)
return true; // overhead
if (grenade->z + grenade->height + explodedist < thing->z)
return true; // underneath
if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y),
thing->z - grenade->z) > explodedist)
return true; // Too far away
grenade->flags2 |= MF2_DEBRIS;
if (thing->player) // Looks like we're going to have to need a seperate function for this too
K_ExplodePlayer(thing->player, grenade->target);
else
P_DamageMobj(thing, grenade, grenade->target, 1);
return true;
}
void A_MineExplode(mobj_t *actor)
{
INT32 bx, by, xl, xh, yl, yh;
explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
INT32 d;
INT32 locvar1 = var1;
mobjtype_t type;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_MineExplode", actor))
return;
#endif
type = (mobjtype_t)locvar1;
// Use blockmap to check for nearby shootables
yh = (unsigned)(actor->y + explodedist - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(actor->y - explodedist - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(actor->x + explodedist - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(actor->x - explodedist - bmaporgx)>>MAPBLOCKSHIFT;
grenade = actor;
for (by = yl; by <= yh; by++)
for (bx = xl; bx <= xh; bx++)
P_BlockThingsIterator(bx, by, PIT_MineExplode);
for (d = 0; d < 16; d++)
K_SpawnKartExplosion(actor->x, actor->y, actor->z, explodedist + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
if (actor->target && actor->target->player)
K_SpawnMineExplosion(actor, actor->target->player->skincolor);
else
K_SpawnMineExplosion(actor, SKINCOLOR_RED);
P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND);
}
//} //}
// Function: A_SetSolidSteam // Function: A_SetSolidSteam
@ -8240,6 +8319,7 @@ void A_JawzExplode(mobj_t *actor)
return; return;
} }
/* old A_MineExplode - see elsewhere in the file
void A_MineExplode(mobj_t *actor) void A_MineExplode(mobj_t *actor)
{ {
mobj_t *mo2; mobj_t *mo2;
@ -8247,12 +8327,14 @@ void A_MineExplode(mobj_t *actor)
INT32 d; INT32 d;
INT32 locvar1 = var1; INT32 locvar1 = var1;
mobjtype_t type; mobjtype_t type;
fixed_t range;
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
if (LUA_CallAction("A_MineExplode", actor)) if (LUA_CallAction("A_MineExplode", actor))
return; return;
#endif #endif
type = (mobjtype_t)locvar1; type = (mobjtype_t)locvar1;
range = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale);
for (th = thinkercap.next; th != &thinkercap; th = th->next) for (th = thinkercap.next; th != &thinkercap; th = th->next)
{ {
@ -8267,27 +8349,25 @@ void A_MineExplode(mobj_t *actor)
if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
continue; continue;
if (!(mo2->flags & MF_SHOOTABLE) || (mo2->flags & MF_SCENERY))
continue;
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target) if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target)
continue; continue;
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance) if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > range)
continue; continue;
if ((mo2->flags & MF_SHOOTABLE) && !(mo2->flags & MF_SCENERY))
{
actor->flags2 |= MF2_DEBRIS; actor->flags2 |= MF2_DEBRIS;
if (mo2->player) // Looks like we're going to have to need a seperate function for this too if (mo2->player) // Looks like we're going to have to need a seperate function for this too
K_ExplodePlayer(mo2->player, actor->target); K_ExplodePlayer(mo2->player, actor->target);
else else
P_DamageMobj(mo2, actor, actor->target, 1); P_DamageMobj(mo2, actor, actor->target, 1);
continue;
}
} }
for (d = 0; d < 16; d++) for (d = 0; d < 16; d++)
K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 K_SpawnKartExplosion(actor->x, actor->y, actor->z, range + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64
if (actor->target && actor->target->player) if (actor->target && actor->target->player)
K_SpawnMineExplosion(actor, actor->target->player->skincolor); K_SpawnMineExplosion(actor, actor->target->player->skincolor);
@ -8297,7 +8377,7 @@ void A_MineExplode(mobj_t *actor)
P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND);
return; return;
} }*/
void A_BallhogExplode(mobj_t *actor) void A_BallhogExplode(mobj_t *actor)
{ {

View file

@ -96,55 +96,6 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
// GET STUFF // GET STUFF
// //
/** Makes sure all previous starposts are cleared.
* For instance, hitting starpost 5 will clear starposts 1 through 4, even if
* you didn't touch them. This is how the classic games work, although it can
* lead to bizarre situations on levels that allow you to make a circuit.
*
* \param postnum The number of the starpost just touched.
*/
void P_ClearStarPost(INT32 postnum)
{
thinker_t *th;
mobj_t *mo2;
// scan the thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2->type == MT_STARPOST && mo2->health <= postnum)
P_SetMobjState(mo2, mo2->info->seestate);
}
return;
}
//
// P_ResetStarposts
//
// Resets all starposts back to their spawn state, used on A_Mixup and some other things.
//
void P_ResetStarposts(void)
{
// Search through all the thinkers.
thinker_t *th;
mobj_t *post;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
post = (mobj_t *)th;
if (post->type == MT_STARPOST)
P_SetMobjState(post, post->info->spawnstate);
}
}
// //
// P_CanPickupItem // P_CanPickupItem
// //
@ -299,14 +250,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (heightcheck) if (heightcheck)
{ {
if (special->type == MT_FLINGEMERALD) // little hack here... /*if (special->type == MT_FLINGEMERALD) // little hack here...
{ // flingemerald sprites are low to the ground, so extend collision radius down some. { // flingemerald sprites are low to the ground, so extend collision radius down some.
if (toucher->z > (special->z + special->height)) if (toucher->z > (special->z + special->height))
return; return;
if (special->z - special->height > (toucher->z + toucher->height)) if (special->z - special->height > (toucher->z + toucher->height))
return; return;
} }
else else*/
{ {
if (toucher->momz < 0) { if (toucher->momz < 0) {
if (toucher->z + toucher->momz > special->z + special->height) if (toucher->z + toucher->momz > special->z + special->height)
@ -341,7 +292,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (special->flags & MF_BOSS) if (special->flags & MF_BOSS)
{ {
if (special->type == MT_BLACKEGGMAN) /*if (special->type == MT_BLACKEGGMAN)
{ {
P_DamageMobj(toucher, special, special, 1); // ouch P_DamageMobj(toucher, special, special, 1); // ouch
return; return;
@ -357,7 +308,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
toucher->momy = -toucher->momy; toucher->momy = -toucher->momy;
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP)))
&& player->charability == CA_FLY && player->charability == CA_FLY
@ -368,8 +318,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
*/ // SRB2kart - Removed: No more fly states // SRB2kart - Removed: No more fly states
else else*/
P_DamageMobj(toucher, special, special, 1); P_DamageMobj(toucher, special, special, 1);
return; return;
@ -379,7 +329,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
/////ENEMIES!!////////////////////////////////////////// /////ENEMIES!!//////////////////////////////////////////
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) /*if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|| player->powers[pw_invulnerability] || player->powers[pw_super]) || player->powers[pw_invulnerability] || player->powers[pw_super])
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
{ {
@ -401,7 +351,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
/*
else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP))
|| (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE
&& player->charability == CA_FLY && player->charability == CA_FLY
@ -413,8 +362,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(special, toucher, toucher, 1); P_DamageMobj(special, toucher, toucher, 1);
} }
*/ // SRB2kart - Removed: No more fly states // SRB2kart - Removed: No more fly states
else else*/
P_DamageMobj(toucher, special, special, 1); P_DamageMobj(toucher, special, special, 1);
return; return;
@ -494,12 +443,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
K_StripOther(player); K_StripOther(player);
player->kartstuff[k_itemroulette] = 1; player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 2; player->kartstuff[k_roulettetype] = 2;
if (special->target && special->target->player if (special->target && special->target->player)
&& (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)) {
if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)
player->kartstuff[k_eggmanblame] = special->target->player-players; player->kartstuff[k_eggmanblame] = special->target->player-players;
else else
player->kartstuff[k_eggmanblame] = player-players; player->kartstuff[k_eggmanblame] = player-players;
if (special->target->hnext == special)
{
P_SetTarget(&special->target->hnext, NULL);
special->target->player->kartstuff[k_eggmanheld] = 0;
}
}
P_RemoveMobj(special); P_RemoveMobj(special);
return; return;
} }
@ -843,7 +800,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// ********************************** // // ********************************** //
// NiGHTS gameplay items and powerups // // NiGHTS gameplay items and powerups //
// ********************************** // // ********************************** //
case MT_NIGHTSDRONE: /*case MT_NIGHTSDRONE:
if (player->bot) if (player->bot)
return; return;
if (player->exiting) if (player->exiting)
@ -1034,7 +991,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// Clear text // Clear text
player->texttimer = 0; player->texttimer = 0;
return; return;*/
case MT_NIGHTSBUMPER: case MT_NIGHTSBUMPER:
// Don't trigger if the stage is ended/failed // Don't trigger if the stage is ended/failed
if (player->exiting) if (player->exiting)
@ -1102,7 +1059,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
} }
} }
return; return;
case MT_NIGHTSSUPERLOOP: /*case MT_NIGHTSSUPERLOOP:
if (player->bot || !(player->pflags & PF_NIGHTSMODE)) if (player->bot || !(player->pflags & PF_NIGHTSMODE))
return; return;
if (!G_IsSpecialStage(gamemap)) if (!G_IsSpecialStage(gamemap))
@ -1235,7 +1192,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
HU_SetCEchoDuration(4); HU_SetCEchoDuration(4);
HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze")); HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze"));
} }
break; break;*/
case MT_NIGHTSWING: case MT_NIGHTSWING:
if (G_IsSpecialStage(gamemap) && useNightsSS) if (G_IsSpecialStage(gamemap) && useNightsSS)
{ // Pseudo-ring. { // Pseudo-ring.
@ -1387,35 +1344,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->starpostangle = special->angle; player->starpostangle = special->angle;
player->starpostnum = special->health; player->starpostnum = special->health;
player->starpostcount++; player->starpostcount++;
P_ClearStarPost(special->health);
// Find all starposts in the level with this value. //S_StartSound(toucher, special->info->painsound);
{
thinker_t *th;
mobj_t *mo2;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2 == special)
continue;
if (mo2->type == MT_STARPOST && mo2->health == special->health)
{
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(mo2, mo2->info->painstate);
}
}
}
S_StartSound(toucher, special->info->painsound);
if (!(netgame && circuitmap && player != &players[consoleplayer]))
P_SetMobjState(special, special->info->painstate);
return; return;
case MT_FAKEMOBILE: case MT_FAKEMOBILE:
@ -1914,7 +1844,7 @@ void P_CheckTimeLimit(void)
//Tagmode round end but only on the tic before the //Tagmode round end but only on the tic before the
//XD_EXITLEVEL packet is received by all players. //XD_EXITLEVEL packet is received by all players.
if (G_TagGametype()) /*if (G_TagGametype())
{ {
if (leveltime == (timelimitintics + 1)) if (leveltime == (timelimitintics + 1))
{ {
@ -1931,7 +1861,7 @@ void P_CheckTimeLimit(void)
} }
//Optional tie-breaker for Match/CTF //Optional tie-breaker for Match/CTF
else if (cv_overtime.value) else*/ if (cv_overtime.value)
{ {
INT32 playerarray[MAXPLAYERS]; INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0; INT32 tempplayer = 0;
@ -2064,7 +1994,7 @@ void P_CheckPointLimit(void)
/*Checks for untagged remaining players in both tag derivitave modes. /*Checks for untagged remaining players in both tag derivitave modes.
*If no untagged players remain, end the round. *If no untagged players remain, end the round.
*Also serves as error checking if the only IT player leaves.*/ *Also serves as error checking if the only IT player leaves.*/
void P_CheckSurvivors(void) /*void P_CheckSurvivors(void)
{ {
INT32 i; INT32 i;
INT32 survivors = 0; INT32 survivors = 0;
@ -2144,7 +2074,7 @@ void P_CheckSurvivors(void)
if (server) if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0); SendNetXCmd(XD_EXITLEVEL, NULL, 0);
} }
} }*/
// Checks whether or not to end a race netgame. // Checks whether or not to end a race netgame.
boolean P_CheckRacers(void) boolean P_CheckRacers(void)
@ -2444,7 +2374,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
localaiming4 = 0; localaiming4 = 0;
//tag deaths handled differently in suicide cases. Don't count spectators! //tag deaths handled differently in suicide cases. Don't count spectators!
if (G_TagGametype() /*if (G_TagGametype()
&& !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator)) && !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator))
{ {
// if you accidentally die before you run out of time to hide, ignore it. // if you accidentally die before you run out of time to hide, ignore it.
@ -2478,7 +2408,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
} }
} }
} }
else if (G_BattleGametype()) else*/ if (G_BattleGametype())
K_CheckBumpers(); K_CheckBumpers();
target->player->kartstuff[k_pogospring] = 0; target->player->kartstuff[k_pogospring] = 0;
@ -2841,7 +2771,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
} }
// The tag occurs so long as you aren't shooting another tagger with friendlyfire on. // The tag occurs so long as you aren't shooting another tagger with friendlyfire on.
if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) /*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT))
{ {
P_AddPlayerScore(source->player, 1); //award points to tagger. P_AddPlayerScore(source->player, 1); //award points to tagger.
P_HitDeathMessages(player, inflictor, source); P_HitDeathMessages(player, inflictor, source);
@ -2859,7 +2789,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
//checks if tagger has tagged all players, if so, end round early. //checks if tagger has tagged all players, if so, end round early.
P_CheckSurvivors(); P_CheckSurvivors();
} }*/
P_DoPlayerPain(player, source, inflictor); P_DoPlayerPain(player, source, inflictor);
@ -3385,19 +3315,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
S_StartSound(player->mo, sfx_kc59); S_StartSound(player->mo, sfx_kc59);
return true; return true;
} }
// Self-Propelled Bomb
if (damage == 65)
{
mobj_t *spbexplode;
if (player == source->player)
return false;
// Just need to do this now! Being thrown upwards is done by the explosion.
//P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING);
spbexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
P_SetTarget(&spbexplode->target, source);
return true;
}
//} //}
// Sudden-Death mode // Sudden-Death mode

View file

@ -172,7 +172,7 @@ void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player); void P_PlayerAfterThink(player_t *player);
void P_DoPlayerExit(player_t *player); void P_DoPlayerExit(player_t *player);
void P_DoTimeOver(player_t *player); void P_DoTimeOver(player_t *player);
void P_NightserizePlayer(player_t *player, INT32 ptime); //void P_NightserizePlayer(player_t *player, INT32 ptime);
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move); void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
@ -185,12 +185,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in
//boolean P_SuperReady(player_t *player); //boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate); void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player); boolean P_AnalogMove(player_t *player);
boolean P_TransferToNextMare(player_t *player); /*boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void); UINT8 P_FindLowestMare(void);*/
UINT8 P_FindLowestLap(void); UINT8 P_FindLowestLap(void);
UINT8 P_FindHighestLap(void); UINT8 P_FindHighestLap(void);
void P_FindEmerald(void); void P_FindEmerald(void);
void P_TransferToAxis(player_t *player, INT32 axisnum); //void P_TransferToAxis(player_t *player, INT32 axisnum);
boolean P_PlayerMoving(INT32 pnum); boolean P_PlayerMoving(INT32 pnum);
void P_SpawnThokMobj(player_t *player); void P_SpawnThokMobj(player_t *player);
void P_SpawnSpinMobj(player_t *player, mobjtype_t type); void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
@ -231,7 +231,7 @@ boolean P_MobjWasRemoved(mobj_t *th);
void P_RemoveSavegameMobj(mobj_t *th); void P_RemoveSavegameMobj(mobj_t *th);
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
boolean P_SetMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
void P_RunShields(void); //void P_RunShields(void);
void P_RunOverlays(void); void P_RunOverlays(void);
void P_RunShadows(void); void P_RunShadows(void);
void P_MobjThinker(mobj_t *mobj); void P_MobjThinker(mobj_t *mobj);
@ -406,12 +406,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_PlayerFlagBurst(player_t *player, boolean toss); void P_PlayerFlagBurst(player_t *player, boolean toss);
void P_CheckTimeLimit(void); void P_CheckTimeLimit(void);
void P_CheckPointLimit(void); void P_CheckPointLimit(void);
void P_CheckSurvivors(void); //void P_CheckSurvivors(void);
boolean P_CheckRacers(void); boolean P_CheckRacers(void);
void P_ClearStarPost(INT32 postnum);
void P_ResetStarposts(void);
boolean P_CanPickupItem(player_t *player, UINT8 weapon); boolean P_CanPickupItem(player_t *player, UINT8 weapon);
void P_DoNightsScore(player_t *player); void P_DoNightsScore(player_t *player);

View file

@ -316,7 +316,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
break; break;
if (object->player) if (object->player)
object->player->kartstuff[k_pogospring] = 1; object->player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(object, 0, true); K_DoPogoSpring(object, 0, 0);
return; return;
} }
else else
@ -469,7 +469,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
#endif #endif
// Metal Sonic destroys tiny baby objects. // Metal Sonic destroys tiny baby objects.
if (tmthing->type == MT_METALSONIC_RACE /*if (tmthing->type == MT_METALSONIC_RACE
&& (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE))
{ {
if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE)))
@ -495,7 +495,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing); P_KillMobj(thing, tmthing, tmthing);
} }
return true; return true;
} }*/
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING))
return true; return true;
@ -647,9 +647,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
// check for skulls slamming into things // check for skulls slamming into things
if (tmthing->flags2 & MF2_SKULLFLY) if (tmthing->flags2 & MF2_SKULLFLY)
{ {
if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! /*if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop!
return true; // Let him RUN YOU RIGHT OVER. >:3 return true; // Let him RUN YOU RIGHT OVER. >:3
else else*/
{ {
// see if it went over / under // see if it went over / under
if (tmthing->z > thing->z + thing->height) if (tmthing->z > thing->z + thing->height)
@ -1133,7 +1133,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; return true;
// Missiles ignore Brak's helper. // Missiles ignore Brak's helper.
if (thing->type == MT_BLACKEGGMAN_HELPER) /*if (thing->type == MT_BLACKEGGMAN_HELPER)
return true; return true;
// Hurting Brak // Hurting Brak
@ -1144,9 +1144,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35])) if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35]))
P_SetMobjState(thing, thing->info->painstate); P_SetMobjState(thing, thing->info->painstate);
return false; return false;
} }*/
if (!(thing->flags & MF_SHOOTABLE) && !(thing->type == MT_EGGSHIELD)) if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/)
{ {
// didn't do any damage // didn't do any damage
return !(thing->flags & MF_SOLID); return !(thing->flags & MF_SOLID);
@ -1157,7 +1157,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
&& thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target) && thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target)
return true; // Don't give rings to your carry player by accident. return true; // Don't give rings to your carry player by accident.
if (thing->type == MT_EGGSHIELD) /*if (thing->type == MT_EGGSHIELD)
{ {
fixed_t touchx, touchy; fixed_t touchx, touchy;
angle_t angle; angle_t angle;
@ -1183,14 +1183,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_KillMobj(thing, tmthing, tmthing); P_KillMobj(thing, tmthing, tmthing);
return false; return false;
} }
} }*/
if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE) if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE)
return true; return true;
// damage / explode // damage / explode
if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example)
P_DamageMobj(thing, tmthing, tmthing, 1); P_DamageMobj(thing, tmthing, tmthing, 1);
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player /*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
&& (thing->player->pflags & PF_JUMPED) && (thing->player->pflags & PF_JUMPED)
&& !thing->player->powers[pw_flashing] && !thing->player->powers[pw_flashing]
&& thing->tracer != tmthing && thing->tracer != tmthing
@ -1230,16 +1230,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
tmthing->x = thing->x; tmthing->x = thing->x;
tmthing->y = thing->y; tmthing->y = thing->y;
P_SetThingPosition(tmthing); P_SetThingPosition(tmthing);
} }*/
else else
P_DamageMobj(thing, tmthing, tmthing->target, 1); P_DamageMobj(thing, tmthing, tmthing->target, 1);
// don't traverse any more // don't traverse any more
if (tmthing->type == MT_SHELL) return (tmthing->type == MT_SHELL);
return true;
else
return false;
} }
if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE) if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE)
@ -1303,7 +1300,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
// Respawn rings and items // Respawn rings and items
if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) /*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
&& (tmthing->player || thing->player)) && (tmthing->player || thing->player))
{ {
mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing;
@ -1323,7 +1320,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
droneobj->extravalue1 = pl->anotherflyangle; droneobj->extravalue1 = pl->anotherflyangle;
droneobj->extravalue2 = (INT32)leveltime + TICRATE; droneobj->extravalue2 = (INT32)leveltime + TICRATE;
} }*/
// check for special pickup // check for special pickup
if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY) if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY)
@ -1394,7 +1391,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (thing->scale > tmthing->scale + (FRACUNIT/8)) else if (thing->scale > tmthing->scale + (FRACUNIT/8))
K_SquishPlayer(tmthing->player, thing); K_SquishPlayer(tmthing->player, thing);
// SRB2kart - Starpower! // SRB2kart - Invincibility!
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer]) if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(thing, tmthing, tmthing, 1); P_DamageMobj(thing, tmthing, tmthing, 1);
else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer]) else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer])
@ -1440,7 +1437,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->player) if (thing->player)
{ {
// Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only // Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only
if (tmthing->eflags & MFE_VERTICALFLIP /*if (tmthing->eflags & MFE_VERTICALFLIP
&& (tmthing->z + tmthing->height + tmthing->momz < thing->z && (tmthing->z + tmthing->height + tmthing->momz < thing->z
|| tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height)) || tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height))
; ;
@ -1462,7 +1459,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// The tmthing->target allows the pusher of the object // The tmthing->target allows the pusher of the object
// to get the point if he topples it on an opponent. // to get the point if he topples it on an opponent.
} }
} }*/
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM) if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
P_DoFanAndGasJet(tmthing, thing); P_DoFanAndGasJet(tmthing, thing);
@ -1585,9 +1582,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
; // Fix a few nasty spring-jumping bugs that happen sometimes. ; // Fix a few nasty spring-jumping bugs that happen sometimes.
// Monitors are not treated as solid to players who are jumping, spinning or gliding, // Monitors are not treated as solid to players who are jumping, spinning or gliding,
// unless it's a CTF team monitor and you're on the wrong team // unless it's a CTF team monitor and you're on the wrong team
else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) /*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
&& !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2)))
; ;*/
// z checking at last // z checking at last
// Treat noclip things as non-solid! // Treat noclip things as non-solid!
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID

View file

@ -495,7 +495,7 @@ boolean P_WeaponOrPanel(mobjtype_t type)
// //
// Power Stone emerald management // Power Stone emerald management
// //
void P_EmeraldManager(void) /*void P_EmeraldManager(void)
{ {
thinker_t *think; thinker_t *think;
mobj_t *mo; mobj_t *mo;
@ -664,7 +664,7 @@ void P_EmeraldManager(void)
break; break;
} }
} }
} }*/
// //
// P_ExplodeMissile // P_ExplodeMissile
@ -6059,7 +6059,7 @@ static void P_NightsItemChase(mobj_t *thing)
P_Attract(thing, thing->tracer, true); P_Attract(thing, thing->tracer, true);
} }
static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) /*static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
{ {
if (!thing->target || thing->target->health <= 0 || !thing->target->player if (!thing->target || thing->target->health <= 0 || !thing->target->player
|| (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super]
@ -6175,7 +6175,7 @@ static boolean P_AddShield(mobj_t *thing)
P_SetTarget(&shields[numshields++], thing); P_SetTarget(&shields[numshields++], thing);
return true; return true;
} }*/
void P_RunOverlays(void) void P_RunOverlays(void)
{ {
@ -6609,7 +6609,7 @@ void P_MobjThinker(mobj_t *mobj)
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
else
P_AddOverlay(mobj); P_AddOverlay(mobj);
break; break;
case MT_SHADOW: case MT_SHADOW:
@ -6618,10 +6618,10 @@ void P_MobjThinker(mobj_t *mobj)
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return; return;
} }
else
P_AddShadow(mobj); P_AddShadow(mobj);
break; break;
case MT_BLACKORB: /*case MT_BLACKORB:
case MT_WHITEORB: case MT_WHITEORB:
case MT_GREENORB: case MT_GREENORB:
case MT_YELLOWORB: case MT_YELLOWORB:
@ -6629,7 +6629,7 @@ void P_MobjThinker(mobj_t *mobj)
case MT_PITYORB: case MT_PITYORB:
if (!P_AddShield(mobj)) if (!P_AddShield(mobj))
return; return;
break; break;*/
//{ SRB2kart mobs //{ SRB2kart mobs
case MT_ORBINAUT_SHIELD: // Kart orbit/trail items case MT_ORBINAUT_SHIELD: // Kart orbit/trail items
case MT_JAWZ_SHIELD: case MT_JAWZ_SHIELD:
@ -8036,7 +8036,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
} }
if (mobj->threshold > 0) if (mobj->threshold > 0)
@ -8111,7 +8111,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
break; break;
} }
@ -8140,7 +8140,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
K_DoPogoSpring(mobj, 0, false); K_DoPogoSpring(mobj, 0, 1);
} }
if (mobj->threshold > 0) if (mobj->threshold > 0)

View file

@ -2865,7 +2865,6 @@ boolean P_SetupLevel(boolean skipprecip)
if (players[i].starposttime) if (players[i].starposttime)
{ {
G_SpawnPlayer(i, true); G_SpawnPlayer(i, true);
P_ClearStarPost(players[i].starpostnum);
} }
else else
G_SpawnPlayer(i, false); G_SpawnPlayer(i, false);
@ -2916,7 +2915,9 @@ boolean P_SetupLevel(boolean skipprecip)
} }
else if (G_RaceGametype() && server) else if (G_RaceGametype() && server)
CV_StealthSetValue(&cv_numlaps, CV_StealthSetValue(&cv_numlaps,
((netgame || multiplayer) && cv_basenumlaps.value) ((netgame || multiplayer) && cv_basenumlaps.value
&& (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|| (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value)))
? cv_basenumlaps.value ? cv_basenumlaps.value
: mapheaderinfo[gamemap - 1]->numlaps); : mapheaderinfo[gamemap - 1]->numlaps);

View file

@ -1707,16 +1707,16 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (actor && actor->player && triggerline->flags & ML_EFFECT4) if (actor && actor->player && triggerline->flags & ML_EFFECT4)
{ {
if (maptol & TOL_NIGHTS) /*if (maptol & TOL_NIGHTS)
lap = actor->player->mare; lap = actor->player->mare;
else else*/
lap = actor->player->laps; lap = actor->player->laps;
} }
else else
{ {
if (maptol & TOL_NIGHTS) /*if (maptol & TOL_NIGHTS)
lap = P_FindLowestMare(); lap = P_FindLowestMare();
else else*/
lap = P_FindLowestLap(); lap = P_FindLowestLap();
} }
@ -3790,7 +3790,7 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, minspeed); P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_pogospring] = 1; player->kartstuff[k_pogospring] = 1;
K_DoPogoSpring(player->mo, 0, false); K_DoPogoSpring(player->mo, 0, 1);
} }
break; break;
@ -3813,7 +3813,7 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, minspeed); P_InstaThrust(player->mo, player->mo->angle, minspeed);
player->kartstuff[k_pogospring] = 2; player->kartstuff[k_pogospring] = 2;
K_DoPogoSpring(player->mo, 0, false); K_DoPogoSpring(player->mo, 0, 1);
} }
break; break;
@ -4252,7 +4252,6 @@ DoneSection2:
// //
//player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostangle = player->starposttime = player->starpostnum = 0;
//player->starpostx = player->starposty = player->starpostz = 0; //player->starpostx = player->starposty = player->starpostz = 0;
P_ResetStarposts();
// Play the starpost sound for 'consistency' // Play the starpost sound for 'consistency'
// S_StartSound(player->mo, sfx_strpst); // S_StartSound(player->mo, sfx_strpst);
@ -5821,10 +5820,8 @@ void P_SpawnSpecials(INT32 fromnetsave)
} }
else // Otherwise, set calculated offsets such that line's v1 is the apparent origin else // Otherwise, set calculated offsets such that line's v1 is the apparent origin
{ {
fixed_t cosinecomponent = FINECOSINE(flatangle>>ANGLETOFINESHIFT); xoffs = -lines[i].v1->x;
fixed_t sinecomponent = FINESINE(flatangle>>ANGLETOFINESHIFT); yoffs = lines[i].v1->y;
xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations.
yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto.
} }
for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;)

View file

@ -96,10 +96,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
thing->player->starpostangle = starpostangle; thing->player->starpostangle = starpostangle;
thing->player->starpostnum = starpostnum; thing->player->starpostnum = starpostnum;
// Reset map starposts for the player's new info.
P_ResetStarposts();
P_ClearStarPost(starpostnum);
P_ResetPlayer(thing->player); P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND

View file

@ -310,7 +310,7 @@ static inline void P_RunThinkers(void)
// //
// Determine if the teams are unbalanced, and if so, move a player to the other team. // Determine if the teams are unbalanced, and if so, move a player to the other team.
// //
static void P_DoAutobalanceTeams(void) /*static void P_DoAutobalanceTeams(void)
{ {
changeteam_union NetPacket; changeteam_union NetPacket;
UINT16 usvalue; UINT16 usvalue;
@ -562,7 +562,7 @@ static inline void P_DoCTFStuff(void)
if (cv_teamscramble.value && server) if (cv_teamscramble.value && server)
P_DoTeamscrambling(); P_DoTeamscrambling();
} }
} }*/
// //
// P_Ticker // P_Ticker
@ -612,11 +612,11 @@ void P_Ticker(boolean run)
if (!demoplayback) // Don't increment if a demo is playing. if (!demoplayback) // Don't increment if a demo is playing.
totalplaytime++; totalplaytime++;
if (!useNightsSS && G_IsSpecialStage(gamemap)) /*if (!useNightsSS && G_IsSpecialStage(gamemap))
P_DoSpecialStageStuff(); P_DoSpecialStageStuff();
if (runemeraldmanager) if (runemeraldmanager)
P_EmeraldManager(); // Power stone mode P_EmeraldManager(); // Power stone mode*/
if (run) if (run)
{ {
@ -633,7 +633,7 @@ void P_Ticker(boolean run)
} }
// Run shield positioning // Run shield positioning
P_RunShields(); //P_RunShields();
P_RunOverlays(); P_RunOverlays();
P_RunShadows(); P_RunShadows();
@ -648,11 +648,11 @@ void P_Ticker(boolean run)
leveltime++; leveltime++;
timeinmap++; timeinmap++;
if (G_TagGametype()) /*if (G_TagGametype())
P_DoTagStuff(); P_DoTagStuff();
if (G_GametypeHasTeams()) if (G_GametypeHasTeams())
P_DoCTFStuff(); P_DoCTFStuff();*/
if (run) if (run)
{ {
@ -748,6 +748,16 @@ void P_Ticker(boolean run)
D_MapChange(gamemap, gametype, encoremode, true, 0, false, false); D_MapChange(gamemap, gametype, encoremode, true, 0, false, false);
} }
// Always move the camera.
if (camera.chase)
P_MoveChaseCamera(&players[displayplayer], &camera, false);
if (splitscreen && camera2.chase)
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
if (splitscreen > 1 && camera3.chase)
P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false);
if (splitscreen > 2 && camera4.chase)
P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false);
P_MapEnd(); P_MapEnd();
// Z_CheckMemCleanup(); // Z_CheckMemCleanup();
@ -793,7 +803,7 @@ void P_PreTicker(INT32 frames)
#endif #endif
// Run shield positioning // Run shield positioning
P_RunShields(); //P_RunShields();
P_RunOverlays(); P_RunOverlays();
P_UpdateSpecials(); P_UpdateSpecials();

View file

@ -344,7 +344,7 @@ void P_ResetScore(player_t *player)
// //
// Returns the lowest open mare available // Returns the lowest open mare available
// //
UINT8 P_FindLowestMare(void) /*UINT8 P_FindLowestMare(void)
{ {
thinker_t *th; thinker_t *th;
mobj_t *mo2; mobj_t *mo2;
@ -375,7 +375,7 @@ UINT8 P_FindLowestMare(void)
CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare); CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare);
return mare; return mare;
} }*/
// //
// P_FindLowestLap // P_FindLowestLap
@ -438,7 +438,7 @@ UINT8 P_FindHighestLap(void)
// (Finds the lowest mare # for capsules that have not been destroyed). // (Finds the lowest mare # for capsules that have not been destroyed).
// Returns true if successful, false if there is no other mare. // Returns true if successful, false if there is no other mare.
// //
boolean P_TransferToNextMare(player_t *player) /*boolean P_TransferToNextMare(player_t *player)
{ {
thinker_t *th; thinker_t *th;
mobj_t *mo2; mobj_t *mo2;
@ -759,7 +759,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
if (G_IsSpecialStage(gamemap)) if (G_IsSpecialStage(gamemap))
{ {
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/) if (playeringame[i])
total_rings += players[i].health-1; total_rings += players[i].health-1;
} }
@ -782,10 +782,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
P_AddPlayerScore(&players[i], (players[i].health - 1) * 50); P_AddPlayerScore(&players[i], (players[i].health - 1) * 50);
} }
// Add score to leaderboards now
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i]))
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/
// transfer scores anyway // transfer scores anyway
players[i].mo->health = players[i].health = 1; players[i].mo->health = players[i].health = 1;
@ -803,10 +799,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
player->textvar = 4; // Score and grades player->textvar = 4; // Score and grades
player->finishedrings = (INT16)(player->health - 1); player->finishedrings = (INT16)(player->health - 1);
// Add score to temp leaderboards
/*if (!(netgame||multiplayer) && P_IsLocalPlayer(player))
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/
// Starting a new mare, transfer scores // Starting a new mare, transfer scores
player->marebegunat = leveltime; player->marebegunat = leveltime;
@ -824,7 +816,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
} }
player->pflags |= PF_NIGHTSMODE; player->pflags |= PF_NIGHTSMODE;
} }*/
// //
// P_PlayerInPain // P_PlayerInPain
@ -4536,7 +4528,7 @@ INT32 P_GetPlayerControlDirection(player_t *player)
} }
// Control scheme for 2d levels. // Control scheme for 2d levels.
static void P_2dMovement(player_t *player) /*static void P_2dMovement(player_t *player)
{ {
ticcmd_t *cmd; ticcmd_t *cmd;
INT32 topspeed, acceleration, thrustfactor; INT32 topspeed, acceleration, thrustfactor;
@ -4713,7 +4705,7 @@ static void P_2dMovement(player_t *player)
else if (player->rmomx > -topspeed && cmd->sidemove < 0) else if (player->rmomx > -topspeed && cmd->sidemove < 0)
P_Thrust(player->mo, movepushangle, movepushforward); P_Thrust(player->mo, movepushangle, movepushforward);
} }
} }*/
//#define OLD_MOVEMENT_CODE 1 //#define OLD_MOVEMENT_CODE 1
static void P_3dMovement(player_t *player) static void P_3dMovement(player_t *player)
@ -5004,7 +4996,7 @@ static void P_SpectatorMovement(player_t *player)
// graphical indicator // graphical indicator
// for building/debugging // for building/debugging
// NiGHTS levels! // NiGHTS levels!
static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) /*static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height)
{ {
mobj_t *mo; mobj_t *mo;
INT32 i; INT32 i;
@ -5578,16 +5570,6 @@ static void P_DoNiGHTSCapsule(player_t *player)
UINT8 em = P_GetNextEmerald(); UINT8 em = P_GetNextEmerald();
tic_t lowest_time; tic_t lowest_time;
/*for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || !players[i].mo || !players[i].mo->tracer)
continue;
emmo = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_GOTEMERALD);
P_SetTarget(&emmo->target, players[i].mo);
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
}*/
if (player->mo->tracer) if (player->mo->tracer)
{ {
// Only give it to ONE person, and THAT player has to get to the goal! // Only give it to ONE person, and THAT player has to get to the goal!
@ -5683,7 +5665,7 @@ static void P_NiGHTSMovement(player_t *player)
boolean capsule = false; boolean capsule = false;
// NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule. // NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ if (playeringame[i]
&& (players[i].capsule && players[i].capsule->reactiontime)) && (players[i].capsule && players[i].capsule->reactiontime))
capsule = true; capsule = true;
if (!capsule if (!capsule
@ -6238,7 +6220,7 @@ static void P_NiGHTSMovement(player_t *player)
if (objectplacing) if (objectplacing)
OP_NightsObjectplace(player); OP_NightsObjectplace(player);
} }*/
// May be used in future for CTF // May be used in future for CTF
#if 0 #if 0
@ -6457,7 +6439,7 @@ void P_ElementalFireTrail(player_t *player)
static void P_MovePlayer(player_t *player) static void P_MovePlayer(player_t *player)
{ {
ticcmd_t *cmd; ticcmd_t *cmd;
INT32 i; //INT32 i;
fixed_t runspd; fixed_t runspd;
@ -6532,7 +6514,7 @@ static void P_MovePlayer(player_t *player)
} }
// Locate the capsule for this mare. // Locate the capsule for this mare.
else if (maptol & TOL_NIGHTS) /*else if (maptol & TOL_NIGHTS)
{ {
if (!player->capsule && !player->bonustime) if (!player->capsule && !player->bonustime)
{ {
@ -6585,15 +6567,15 @@ static void P_MovePlayer(player_t *player)
P_DamageMobj(player->mo, NULL, NULL, 1); P_DamageMobj(player->mo, NULL, NULL, 1);
player->pflags &= ~PF_NIGHTSFALL; player->pflags &= ~PF_NIGHTSFALL;
} }
} }*/
////////////////////// //////////////////////
// MOVEMENT CODE // // MOVEMENT CODE //
////////////////////// //////////////////////
if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. /*if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies.
P_2dMovement(player); P_2dMovement(player);
else else*/
{ {
if (!player->climbing && (!P_AnalogMove(player))) if (!player->climbing && (!P_AnalogMove(player)))
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
@ -7915,7 +7897,7 @@ static void P_DeathThink(player_t *player)
/*if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) /*if (player->deadtimer > 30*TICRATE && !G_RaceGametype())
player->playerstate = PST_REBORN; player->playerstate = PST_REBORN;
else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/ else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/
if (player->lives > 0 && leveltime >= starttime) // *could* you respawn? if (player->lives > 0 /*&& leveltime >= starttime*/) // *could* you respawn?
{ {
// SRB2kart - spawn automatically after 1 second // SRB2kart - spawn automatically after 1 second
if (player->deadtimer > ((netgame || multiplayer) if (player->deadtimer > ((netgame || multiplayer)
@ -8188,7 +8170,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|| (leveltime < introtime)); // Kart intro cam || (leveltime < introtime)); // Kart intro cam
#endif #endif
if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) if (!(player->playerstate == PST_DEAD || player->exiting))
{ {
if (player->spectator) // force cam off for spectators if (player->spectator) // force cam off for spectators
return true; return true;
@ -8681,9 +8663,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
{ {
// Don't let the camera match your movement. // Don't let the camera match your movement.
thiscam->momz = 0; thiscam->momz = 0;
if (player->spectator)
thiscam->aiming = 0;
// Only let the camera go a little bit downwards. // Only let the camera go a little bit downwards.
if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) else if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180)
thiscam->aiming = ANGLE_337h; thiscam->aiming = ANGLE_337h;
else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180) else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180)
thiscam->aiming = ANGLE_22h; thiscam->aiming = ANGLE_22h;
@ -9441,8 +9424,8 @@ void P_PlayerThink(player_t *player)
player->losstime--; player->losstime--;
// Flash player after being hit. // Flash player after being hit.
if (!(player->pflags & PF_NIGHTSMODE if (!(//player->pflags & PF_NIGHTSMODE ||
|| player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| player->kartstuff[k_respawn] // Respawn timer (for drop dash effect) || player->kartstuff[k_respawn] // Respawn timer (for drop dash effect)
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer])
@ -9454,13 +9437,13 @@ void P_PlayerThink(player_t *player)
else else
player->mo->flags2 &= ~MF2_DONTDRAW; player->mo->flags2 &= ~MF2_DONTDRAW;
} }
else if (player->mo->tracer) /*else if (player->mo->tracer)
{ {
if (player->powers[pw_flashing] & 1) if (player->powers[pw_flashing] & 1)
player->mo->tracer->flags2 |= MF2_DONTDRAW; player->mo->tracer->flags2 |= MF2_DONTDRAW;
else else
player->mo->tracer->flags2 &= ~MF2_DONTDRAW; player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
} }*/
player->pflags &= ~PF_SLIDING; player->pflags &= ~PF_SLIDING;
@ -9546,12 +9529,6 @@ void P_PlayerAfterThink(player_t *player)
if (player->playerstate == PST_DEAD) if (player->playerstate == PST_DEAD)
{ {
// camera may still move when guy is dead
//if (!netgame)
{
if (thiscam && thiscam->chase)
P_MoveChaseCamera(player, thiscam, false);
}
return; return;
} }
@ -9833,8 +9810,6 @@ void P_PlayerAfterThink(player_t *player)
player->viewz = player->mo->z + player->mo->height - player->viewheight; player->viewz = player->mo->z + player->mo->height - player->viewheight;
else else
player->viewz = player->mo->z + player->viewheight; player->viewz = player->mo->z + player->viewheight;
if (server || addedtogame)
P_MoveChaseCamera(player, thiscam, false); // calculate the camera movement
} }
} }

View file

@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end)
newend = solidsegs + 2; newend = solidsegs + 2;
} }
// R_DoorClosed
//
// This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff.
//
// It assumes that Doom has already ruled out a door being closed because
// of front-back closure (e.g. front floor is taller than back ceiling).
static INT32 R_DoorClosed(void)
{
return
// if door is closed because back is shut:
backsector->ceilingheight <= backsector->floorheight
// preserve a kind of transparent door/lift special effect:
&& (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
&& (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
// properly render skies (consider door "open" if both ceilings are sky):
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum);
}
// //
// If player's view height is underneath fake floor, lower the // If player's view height is underneath fake floor, lower the
// drawn ceiling to be just under the floor height, and replace // drawn ceiling to be just under the floor height, and replace
@ -502,6 +478,8 @@ static void R_AddLine(seg_t *line)
SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight)
SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight)
#undef SLOPEPARAMS #undef SLOPEPARAMS
if (viewsector != backsector && viewsector != frontsector)
{
if ((backc1 <= frontf1 && backc2 <= frontf2) if ((backc1 <= frontf1 && backc2 <= frontf2)
|| (backf1 >= frontc1 && backf2 >= frontc2)) || (backf1 >= frontc1 && backf2 >= frontc2))
{ {
@ -516,6 +494,7 @@ static void R_AddLine(seg_t *line)
if (doorclosed) if (doorclosed)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (backc1 != frontc1 || backc2 != frontc2 if (backc1 != frontc1 || backc2 != frontc2
@ -526,6 +505,8 @@ static void R_AddLine(seg_t *line)
} }
else else
#endif #endif
{
if (viewsector != backsector && viewsector != frontsector)
{ {
if (backsector->ceilingheight <= frontsector->floorheight if (backsector->ceilingheight <= frontsector->floorheight
|| backsector->floorheight >= frontsector->ceilingheight) || backsector->floorheight >= frontsector->ceilingheight)
@ -534,9 +515,14 @@ static void R_AddLine(seg_t *line)
} }
// Check for automap fix. Store in doorclosed for r_segs.c // Check for automap fix. Store in doorclosed for r_segs.c
doorclosed = R_DoorClosed(); doorclosed = (backsector->ceilingheight <= backsector->floorheight
&& (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture)
&& (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture)
&& (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum));
if (doorclosed) if (doorclosed)
goto clipsolid; goto clipsolid;
}
// Window. // Window.
if (backsector->ceilingheight != frontsector->ceilingheight if (backsector->ceilingheight != frontsector->ceilingheight
@ -1126,30 +1112,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber)
&& polysec->floorheight >= floorcenterz && polysec->floorheight >= floorcenterz
&& (viewz < polysec->floorheight)) && (viewz < polysec->floorheight))
{ {
fixed_t xoff, yoff;
xoff = polysec->floor_xoffs;
yoff = polysec->floor_yoffs;
if (po->angle != 0) {
angle_t fineshift = po->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y);
} else {
xoff -= po->centerPt.x;
yoff += po->centerPt.y;
}
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
light = 0; light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
polysec->lightlevel, xoff, yoff, polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
polysec->floorpic_angle-po->angle, polysec->floorpic_angle-po->angle,
NULL, NULL, NULL, po
NULL
#ifdef POLYOBJECTS_PLANES
, po
#endif
#ifdef ESLOPE #ifdef ESLOPE
, NULL // will ffloors be slopable eventually? , NULL // will ffloors be slopable eventually?
#endif #endif
@ -1174,28 +1142,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber)
&& polysec->ceilingheight <= ceilingcenterz && polysec->ceilingheight <= ceilingcenterz
&& (viewz > polysec->ceilingheight)) && (viewz > polysec->ceilingheight))
{ {
fixed_t xoff, yoff;
xoff = polysec->ceiling_xoffs;
yoff = polysec->ceiling_yoffs;
if (po->angle != 0) {
angle_t fineshift = po->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y);
} else {
xoff -= po->centerPt.x;
yoff += po->centerPt.y;
}
light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight); light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight);
light = 0; light = 0;
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle, polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs,
NULL, NULL polysec->ceilingpic_angle-po->angle,
#ifdef POLYOBJECTS_PLANES NULL, NULL, po
, po
#endif
#ifdef ESLOPE #ifdef ESLOPE
, NULL // will ffloors be slopable eventually? , NULL // will ffloors be slopable eventually?
#endif #endif

View file

@ -1094,10 +1094,10 @@ void R_SetupFrame(player_t *player, boolean skybox)
chasecam = (cv_chasecam.value != 0); chasecam = (cv_chasecam.value != 0);
} }
if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD) if (player->spectator) // no spectator chasecam
chasecam = true; // force chasecam on
else if (player->spectator) // no spectator chasecam
chasecam = false; // force chasecam off chasecam = false; // force chasecam off
else if (player->playerstate == PST_DEAD || player->exiting)
chasecam = true; // force chasecam on
if (chasecam && !thiscam->chase) if (chasecam && !thiscam->chase)
{ {

View file

@ -450,18 +450,36 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
#ifdef ESLOPE #ifdef ESLOPE
if (slope); else // Don't mess with this right now if a slope is involved if (slope); else // Don't mess with this right now if a slope is involved
#endif #endif
if (plangle != 0)
{
// Add the view offset, rotated by the plane angle.
angle_t angle = plangle>>ANGLETOFINESHIFT;
xoff += FixedMul(viewx,FINECOSINE(angle))-FixedMul(viewy,FINESINE(angle));
yoff += -FixedMul(viewx,FINESINE(angle))-FixedMul(viewy,FINECOSINE(angle));
}
else
{ {
xoff += viewx; xoff += viewx;
yoff -= viewy; yoff -= viewy;
if (plangle != 0)
{
// Add the view offset, rotated by the plane angle.
fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT);
fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT);
fixed_t oldxoff = xoff;
xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent);
yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent);
} }
}
#ifdef POLYOBJECTS_PLANES
if (polyobj)
{
if (polyobj->angle != 0)
{
angle_t fineshift = polyobj->angle >> ANGLETOFINESHIFT;
xoff -= FixedMul(FINECOSINE(fineshift), polyobj->centerPt.x)+FixedMul(FINESINE(fineshift), polyobj->centerPt.y);
yoff -= FixedMul(FINESINE(fineshift), polyobj->centerPt.x)-FixedMul(FINECOSINE(fineshift), polyobj->centerPt.y);
}
else
{
xoff -= polyobj->centerPt.x;
yoff += polyobj->centerPt.y;
}
}
#endif
// This appears to fix the Nimbus Ruins sky bug. // This appears to fix the Nimbus Ruins sky bug.
if (picnum == skyflatnum && pfloor) if (picnum == skyflatnum && pfloor)
@ -488,6 +506,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
&& !pfloor && !check->ffloor && !pfloor && !check->ffloor
&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
&& check->viewangle == viewangle && check->viewangle == viewangle
&& check->plangle == plangle
#ifdef ESLOPE #ifdef ESLOPE
&& check->slope == slope && check->slope == slope
#endif #endif
@ -974,23 +993,65 @@ void R_DrawSinglePlane(visplane_t *pl)
#ifdef ESLOPE #ifdef ESLOPE
if (pl->slope) { if (pl->slope) {
// Potentially override other stuff for now cus we're mean. :< But draw a slope plane! // Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
// I copied ZDoom's code and adapted it to SRB2... -Red // I copied ZDoom's code and adapted it to SRB2... -fickle
floatv3_t p, m, n; floatv3_t p, m, n;
float ang; float ang;
float vx, vy, vz; float vx, vy, vz;
float fudge;
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
// use this as a temp var to store P_GetZAt's return value each time // use this as a temp var to store P_GetZAt's return value each time
fixed_t temp; fixed_t temp;
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -fickle
const float fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
angle_t hack = (pl->plangle & (ANGLE_90-1));
if (hack)
{
/*
Essentially: We can't & the components along the regular axes when the plane is rotated.
This is because the distance on each regular axis in order to loop is different.
We rotate them, & the components, add them together, & them again, and then rotate them back.
These three seperate & operations are done per axis in order to prevent overflows.
toast 10/04/17
---
...of coooourse, this still isn't perfect. but it looks... merely kind of grody, rather than
completely wrong? idk. i'm just backporting this to kart right now. if anyone else wants to
ever try dig around: it's drifting towards 0,0, and no, multiplying by fudge doesn't fix it.
toast 27/09/18
*/
const fixed_t cosinecomponent = FINECOSINE(hack>>ANGLETOFINESHIFT);
const fixed_t sinecomponent = FINESINE(hack>>ANGLETOFINESHIFT);
const fixed_t modmask = ((1 << (32-nflatshiftup)) - 1);
fixed_t ox = (FixedMul(pl->slope->o.x,cosinecomponent) & modmask) - (FixedMul(pl->slope->o.y,sinecomponent) & modmask);
fixed_t oy = (-FixedMul(pl->slope->o.x,sinecomponent) & modmask) - (FixedMul(pl->slope->o.y,cosinecomponent) & modmask);
temp = ox & modmask;
oy &= modmask;
ox = FixedMul(temp,cosinecomponent)+FixedMul(oy,-sinecomponent); // negative sine for opposite direction
oy = -FixedMul(temp,-sinecomponent)+FixedMul(oy,cosinecomponent);
temp = xoffs;
xoffs = (FixedMul(temp,cosinecomponent) & modmask) + (FixedMul(yoffs,sinecomponent) & modmask);
yoffs = (-FixedMul(temp,sinecomponent) & modmask) + (FixedMul(yoffs,cosinecomponent) & modmask);
temp = xoffs & modmask;
yoffs &= modmask;
xoffs = FixedMul(temp,cosinecomponent)+FixedMul(yoffs,-sinecomponent); // ditto
yoffs = -FixedMul(temp,-sinecomponent)+FixedMul(yoffs,cosinecomponent);
xoffs -= (pl->slope->o.x - ox);
yoffs += (pl->slope->o.y + oy);
}
else
{
xoffs &= ((1 << (32-nflatshiftup))-1); xoffs &= ((1 << (32-nflatshiftup))-1);
yoffs &= ((1 << (32-nflatshiftup))-1); yoffs &= ((1 << (32-nflatshiftup))-1);
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
}
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red
fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
xoffs = (fixed_t)(xoffs*fudge); xoffs = (fixed_t)(xoffs*fudge);
yoffs = (fixed_t)(yoffs/fudge); yoffs = (fixed_t)(yoffs/fudge);

View file

@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void)
if (bottom >= floorclip[rw_x]) if (bottom >= floorclip[rw_x])
bottom = floorclip[rw_x]-1; bottom = floorclip[rw_x]-1;
if (top <= bottom) if (top <= bottom && ceilingplane)
{ {
ceilingplane->top[rw_x] = (INT16)top; ceilingplane->top[rw_x] = (INT16)top;
ceilingplane->bottom[rw_x] = (INT16)bottom; ceilingplane->bottom[rw_x] = (INT16)bottom;
@ -2113,6 +2113,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// ds_p->sprtopclip = screenheightarray; // ds_p->sprtopclip = screenheightarray;
} }
if (viewsector != frontsector && viewsector != backsector)
{
#ifdef ESLOPE #ifdef ESLOPE
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
#else #else
@ -2160,6 +2162,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->silhouette |= SIL_TOP; ds_p->silhouette |= SIL_TOP;
} }
} }
}
if (worldlow != worldbottom if (worldlow != worldbottom
#ifdef ESLOPE #ifdef ESLOPE

View file

@ -94,7 +94,7 @@ rendermode_t rendermode=render_soft;
boolean highcolor = false; boolean highcolor = false;
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
UINT8 graphics_started = 0; // Is used in console.c and screen.c UINT8 graphics_started = 0; // Is used in console.c and screen.c

View file

@ -150,7 +150,7 @@ boolean highcolor = false;
#if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL)) #if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL))
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#else #else
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif #endif
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -1290,8 +1290,8 @@ UINT8 *V_GetStringColormap(INT32 colorflags)
return steelmap; return steelmap;
case 13: // 0x8D, pink case 13: // 0x8D, pink
return pinkmap; return pinkmap;
case 14: // 0x8E, teal case 14: // 0x8E, brown
return tealmap; return brownmap;
case 15: // 0x8F, peach case 15: // 0x8F, peach
return peachmap; return peachmap;
default: // reset default: // reset

View file

@ -82,7 +82,7 @@ extern UINT8 hudtrans;
#define V_TEAMAP 0x0000B000 #define V_TEAMAP 0x0000B000
#define V_STEELMAP 0x0000C000 #define V_STEELMAP 0x0000C000
#define V_PINKMAP 0x0000D000 #define V_PINKMAP 0x0000D000
#define V_TEALMAP 0x0000E000 #define V_BROWNMAP 0x0000E000
#define V_PEACHMAP 0x0000F000 #define V_PEACHMAP 0x0000F000
// use bits 17-20 for alpha transparency // use bits 17-20 for alpha transparency

View file

@ -51,7 +51,7 @@ rendermode_t rendermode = render_soft;
static void OnTop_OnChange(void); static void OnTop_OnChange(void);
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}}; static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}};
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -48,7 +48,7 @@
rendermode_t rendermode = render_soft; rendermode_t rendermode = render_soft;
// synchronize page flipping with screen refresh // synchronize page flipping with screen refresh
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
boolean highcolor; boolean highcolor;

View file

@ -560,13 +560,13 @@ void Y_Ticker(void)
// Team scramble code for team match and CTF. // Team scramble code for team match and CTF.
// Don't do this if we're going to automatically scramble teams next round. // Don't do this if we're going to automatically scramble teams next round.
if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) /*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server)
{ {
// If we run out of time in intermission, the beauty is that // If we run out of time in intermission, the beauty is that
// the P_Ticker() team scramble code will pick it up. // the P_Ticker() team scramble code will pick it up.
if ((intertic % (TICRATE/7)) == 0) if ((intertic % (TICRATE/7)) == 0)
P_DoTeamscrambling(); P_DoTeamscrambling();
} }*/
// multiplayer uses timer (based on cv_inttime) // multiplayer uses timer (based on cv_inttime)
if (timer) if (timer)
@ -1137,7 +1137,7 @@ void Y_VoteDrawer(void)
else else
{ {
V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0); V_DrawFixedPatch((x+40)<<FRACBITS, (y)<<FRACBITS, FRACUNIT/4, V_SNAPTOLEFT|V_FLIP, pic, 0);
V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTORIGHT, rubyicon, NULL); V_DrawFixedPatch((x+20)<<FRACBITS, (y<<FRACBITS) + (25<<(FRACBITS-1)) - rubyheight, FRACUNIT/2, V_SNAPTOLEFT, rubyicon, NULL);
} }
if (levelinfo[votes[i]].gts) if (levelinfo[votes[i]].gts)