Merge branch 'dashrings' into splatbooster

This commit is contained in:
Lach 2023-07-20 19:22:30 +10:00
commit ed76ca72fa
26 changed files with 356 additions and 254 deletions

View file

@ -78,6 +78,7 @@ CV_PossibleValue_t CV_OnOff[] = {{0, "Off"}, {1, "On"}, {0, NULL}};
CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}}; CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
CV_PossibleValue_t CV_TrueFalse[] = {{0, "False"}, {1, "True"}, {0, NULL}};
// Cheats // Cheats
#ifdef DEVELOP #ifdef DEVELOP
@ -909,15 +910,17 @@ static void COM_Help_f(void)
{ {
CONS_Printf(" Possible values:\n"); CONS_Printf(" Possible values:\n");
if (cvar->PossibleValue == CV_YesNo) if (cvar->PossibleValue == CV_YesNo)
CONS_Printf(" Yes or No (On or Off, 1 or 0)\n"); CONS_Printf(" Yes or No (On or Off, True or False, 1 or 0)\n");
else if (cvar->PossibleValue == CV_OnOff) else if (cvar->PossibleValue == CV_OnOff)
CONS_Printf(" On or Off (Yes or No, 1 or 0)\n"); CONS_Printf(" On or Off (Yes or No, True or False, 1 or 0)\n");
else if (cvar->PossibleValue == CV_TrueFalse)
CONS_Printf(" True or False (On or Off, Yes or No, 1 or 0)\n");
else if (cvar->PossibleValue == Color_cons_t || cvar->PossibleValue == Followercolor_cons_t) else if (cvar->PossibleValue == Color_cons_t || cvar->PossibleValue == Followercolor_cons_t)
{ {
boolean follower = (cvar->PossibleValue == Followercolor_cons_t); boolean follower = (cvar->PossibleValue == Followercolor_cons_t);
for (i = SKINCOLOR_NONE; i < numskincolors; ++i) for (i = SKINCOLOR_NONE; i < numskincolors; ++i)
{ {
if (K_ColorUsable(i, follower) == true) if (K_ColorUsable(i, follower, true) == true)
{ {
CONS_Printf(" %-3d : %s\n", i, skincolors[i].name); CONS_Printf(" %-3d : %s\n", i, skincolors[i].name);
if (i == cvar->value) if (i == cvar->value)
@ -1565,12 +1568,12 @@ boolean CV_CompleteValue(consvar_t *var, const char **valstrp, INT32 *intval)
goto found; goto found;
} }
// Not found ... but wait, there's hope! // Not found ... but wait, there's hope!
if (var->PossibleValue == CV_OnOff || var->PossibleValue == CV_YesNo) if (var->PossibleValue == CV_OnOff || var->PossibleValue == CV_YesNo || var->PossibleValue == CV_TrueFalse)
{ {
overrideval = -1; overrideval = -1;
if (!stricmp(valstr, "on") || !stricmp(valstr, "yes")) if (!stricmp(valstr, "on") || !stricmp(valstr, "yes") || !stricmp(valstr, "true"))
overrideval = 1; overrideval = 1;
else if (!stricmp(valstr, "off") || !stricmp(valstr, "no")) else if (!stricmp(valstr, "off") || !stricmp(valstr, "no") || !stricmp(valstr, "false"))
overrideval = 0; overrideval = 0;
if (overrideval != -1) if (overrideval != -1)

View file

@ -172,6 +172,7 @@ extern CV_PossibleValue_t CV_OnOff[];
extern CV_PossibleValue_t CV_YesNo[]; extern CV_PossibleValue_t CV_YesNo[];
extern CV_PossibleValue_t CV_Unsigned[]; extern CV_PossibleValue_t CV_Unsigned[];
extern CV_PossibleValue_t CV_Natural[]; extern CV_PossibleValue_t CV_Natural[];
extern CV_PossibleValue_t CV_TrueFalse[];
// SRB2kart // SRB2kart
// the KARTSPEED and KARTGP were previously defined here, but moved to doomstat to avoid circular dependencies // the KARTSPEED and KARTGP were previously defined here, but moved to doomstat to avoid circular dependencies

View file

@ -59,7 +59,7 @@ static boolean con_started = false; // console has been initialised
static boolean con_forcepic = true; // at startup toggle console translucency when first off static boolean con_forcepic = true; // at startup toggle console translucency when first off
boolean con_recalc; // set true when screen size has changed boolean con_recalc; // set true when screen size has changed
static tic_t con_tick; // console ticker for anim or blinking prompt cursor static tic_t con_tick; // console ticker for blinking prompt cursor
// con_scrollup should use time (currenttime - lasttime).. // con_scrollup should use time (currenttime - lasttime)..
static boolean consoletoggle; // true when console key pushed, ticker will handle static boolean consoletoggle; // true when console key pushed, ticker will handle
@ -70,8 +70,8 @@ static INT32 con_curlines; // vid lines currently used by console
INT32 con_clipviewtop; // (useless) INT32 con_clipviewtop; // (useless)
static INT32 con_hudlines; // number of console heads up message lines static UINT8 con_hudlines; // number of console heads up message lines
static INT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines static UINT32 con_hudtime[MAXHUDLINES]; // remaining time of display for hud msg lines
INT32 con_clearlines; // top screen lines to refresh when view reduced INT32 con_clearlines; // top screen lines to refresh when view reduced
boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh boolean con_hudupdate; // when messages scroll, we need a backgrnd refresh
@ -108,6 +108,7 @@ static void CON_RecalcSize(void);
static void CON_ChangeHeight(void); static void CON_ChangeHeight(void);
static void CON_DrawBackpic(void); static void CON_DrawBackpic(void);
static void CONS_height_Change(void);
static void CONS_hudlines_Change(void); static void CONS_hudlines_Change(void);
static void CONS_backcolor_Change(void); static void CONS_backcolor_Change(void);
@ -123,10 +124,13 @@ static void CONS_backcolor_Change(void);
static char con_buffer[CON_BUFFERSIZE]; static char con_buffer[CON_BUFFERSIZE];
// how many seconds the hud messages lasts on the screen // how many seconds the hud messages lasts on the screen
static consvar_t cons_msgtimeout = CVAR_INIT ("con_hudtime", "5", CV_SAVE, CV_Unsigned, NULL); // CV_Unsigned can overflow when multiplied by TICRATE later, so let's use a 3-year limit instead
static CV_PossibleValue_t hudtime_cons_t[] = {{0, "MIN"}, {99999999, "MAX"}, {0, NULL}};
static consvar_t cons_hudtime = CVAR_INIT ("con_hudtime", "5", CV_SAVE, hudtime_cons_t, NULL);
// number of lines displayed on the HUD // number of lines displayed on the HUD
static consvar_t cons_hudlines = CVAR_INIT ("con_hudlines", "5", CV_CALL|CV_SAVE, CV_Unsigned, CONS_hudlines_Change); static CV_PossibleValue_t hudlines_cons_t[] = {{0, "MIN"}, {MAXHUDLINES, "MAX"}, {0, NULL}};
static consvar_t cons_hudlines = CVAR_INIT ("con_hudlines", "5", CV_CALL|CV_SAVE, hudlines_cons_t, CONS_hudlines_Change);
// number of lines console move per frame // number of lines console move per frame
// (con_speed needs a limit, apparently) // (con_speed needs a limit, apparently)
@ -134,7 +138,7 @@ static CV_PossibleValue_t speed_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}};
static consvar_t cons_speed = CVAR_INIT ("con_speed", "8", CV_SAVE, speed_cons_t, NULL); static consvar_t cons_speed = CVAR_INIT ("con_speed", "8", CV_SAVE, speed_cons_t, NULL);
// percentage of screen height to use for console // percentage of screen height to use for console
static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_SAVE, CV_Unsigned, NULL); static consvar_t cons_height = CVAR_INIT ("con_height", "50", CV_CALL|CV_SAVE, CV_Unsigned, CONS_height_Change);
static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}}; static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}, {0, NULL}};
// whether to use console background picture, or translucent mode // whether to use console background picture, or translucent mode
@ -152,6 +156,18 @@ consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Black", CV_CALL|CV_SAVE,
static void CON_Print(char *msg); static void CON_Print(char *msg);
// Change the console height on demand
//
static void CONS_height_Change(void)
{
Lock_state();
if (con_destlines > 0 && !con_startup) // If the console is open (as in, not using "bind")...
CON_ChangeHeight(); // ...update its height now, not only when it's closed and re-opened
Unlock_state();
}
// //
// //
static void CONS_hudlines_Change(void) static void CONS_hudlines_Change(void)
@ -164,11 +180,6 @@ static void CONS_hudlines_Change(void)
for (i = 0; i < con_hudlines; i++) for (i = 0; i < con_hudlines; i++)
con_hudtime[i] = 0; con_hudtime[i] = 0;
if (cons_hudlines.value < 1)
cons_hudlines.value = 1;
else if (cons_hudlines.value > MAXHUDLINES)
cons_hudlines.value = MAXHUDLINES;
con_hudlines = cons_hudlines.value; con_hudlines = cons_hudlines.value;
Unlock_state(); Unlock_state();
@ -449,7 +460,7 @@ void CON_Init(void)
Unlock_state(); Unlock_state();
CV_RegisterVar(&cons_msgtimeout); CV_RegisterVar(&cons_hudtime);
CV_RegisterVar(&cons_hudlines); CV_RegisterVar(&cons_hudlines);
CV_RegisterVar(&cons_speed); CV_RegisterVar(&cons_speed);
CV_RegisterVar(&cons_height); CV_RegisterVar(&cons_height);
@ -614,33 +625,39 @@ static void CON_ChangeHeight(void)
// //
static void CON_MoveConsole(void) static void CON_MoveConsole(void)
{ {
fixed_t conspeed; static fixed_t fracmovement = 0;
Lock_state(); Lock_state();
conspeed = FixedDiv(cons_speed.value*vid.fdupy, FRACUNIT);
// instant // instant
if (!cons_speed.value) if (!cons_speed.value)
{ {
con_curlines = con_destlines; con_curlines = con_destlines;
Unlock_state();
return; return;
} }
// up/down move to dest // Not instant - Increment fracmovement fractionally
if (con_curlines < con_destlines) fracmovement += FixedMul(cons_speed.value*vid.fdupy, renderdeltatics);
if (con_curlines < con_destlines) // Move the console downwards
{ {
con_curlines += FixedInt(conspeed); con_curlines += FixedInt(fracmovement); // Move by fracmovement's integer value
if (con_curlines > con_destlines) if (con_curlines > con_destlines) // If we surpassed the destination...
con_curlines = con_destlines; con_curlines = con_destlines; // ...clamp to it!
} }
else if (con_curlines > con_destlines) else // Move the console upwards
{ {
con_curlines -= FixedInt(conspeed); con_curlines -= FixedInt(fracmovement);
if (con_curlines < con_destlines) if (con_curlines < con_destlines)
con_curlines = con_destlines; con_curlines = con_destlines;
if (con_destlines == 0) // If the console is being closed, not just moved up...
con_tick = 0; // ...don't show the blinking cursor
} }
fracmovement %= FRACUNIT; // Reset fracmovement's integer value, but keep the fraction
Unlock_state(); Unlock_state();
} }
@ -759,10 +776,6 @@ void CON_Ticker(void)
CON_ChangeHeight(); CON_ChangeHeight();
} }
// console movement
if (con_destlines != con_curlines)
CON_MoveConsole();
// clip the view, so that the part under the console is not drawn // clip the view, so that the part under the console is not drawn
con_clipviewtop = -1; con_clipviewtop = -1;
if (cons_backpic.value) // clip only when using an opaque background if (cons_backpic.value) // clip only when using an opaque background
@ -784,9 +797,8 @@ void CON_Ticker(void)
// make overlay messages disappear after a while // make overlay messages disappear after a while
for (i = 0; i < con_hudlines; i++) for (i = 0; i < con_hudlines; i++)
{ {
con_hudtime[i]--; if (con_hudtime[i])
if (con_hudtime[i] < 0) con_hudtime[i]--;
con_hudtime[i] = 0;
} }
Unlock_state(); Unlock_state();
@ -1334,7 +1346,8 @@ boolean CON_Responder(event_t *ev)
static void CON_Linefeed(void) static void CON_Linefeed(void)
{ {
// set time for heads up messages // set time for heads up messages
con_hudtime[con_cy%con_hudlines] = cons_msgtimeout.value*TICRATE; if (con_hudlines)
con_hudtime[con_cy%con_hudlines] = cons_hudtime.value*TICRATE;
con_cy++; con_cy++;
con_cx = 0; con_cx = 0;
@ -1674,7 +1687,7 @@ static void CON_DrawHudlines(void)
INT32 charwidth = 8 * con_scalefactor; INT32 charwidth = 8 * con_scalefactor;
INT32 charheight = 8 * con_scalefactor; INT32 charheight = 8 * con_scalefactor;
if (con_hudlines <= 0) if (!con_hudlines)
return; return;
if (chat_on && OLDCHAT) if (chat_on && OLDCHAT)
@ -1682,7 +1695,7 @@ static void CON_DrawHudlines(void)
else else
y = 0; y = 0;
for (i = con_cy - con_hudlines+1; i <= con_cy; i++) for (i = con_cy - con_hudlines; i <= con_cy; i++)
{ {
size_t c; size_t c;
INT32 x; INT32 x;
@ -1799,41 +1812,41 @@ static void CON_DrawConsole(void)
} }
// draw console text lines from top to bottom // draw console text lines from top to bottom
if (con_curlines < minheight) if (con_curlines >= minheight)
return;
i = con_cy - con_scrollup;
// skip the last empty line due to the cursor being at the start of a new line
i--;
i -= (con_curlines - minheight) / charheight;
if (rendermode == render_none) return;
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
{ {
INT32 x; i = con_cy - con_scrollup;
size_t c;
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width]; // skip the last empty line due to the cursor being at the start of a new line
i--;
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++) i -= (con_curlines - minheight) / charheight;
if (rendermode == render_none) return;
for (y = (con_curlines-minheight) % charheight; y <= con_curlines-minheight; y += charheight, i++)
{ {
while (*p & 0x80) INT32 x;
size_t c;
p = (UINT8 *)&con_buffer[((i > 0 ? i : 0)%con_totallines)*con_width];
for (c = 0, x = charwidth; c < con_width; c++, x += charwidth, p++)
{ {
charflags = (*p & 0x7f) << V_CHARCOLORSHIFT; while (*p & 0x80)
p++; {
c++; charflags = (*p & 0x7f) << V_CHARCOLORSHIFT;
p++;
c++;
}
if (c >= con_width)
break;
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
} }
if (c >= con_width)
break;
V_DrawCharacter(x, y, (INT32)(*p) | charflags | cv_constextsize.value | V_NOSCALESTART, true);
} }
} }
// draw prompt if enough place (not while game startup) // draw prompt if enough place (not while game startup)
if ((con_curlines == con_destlines) && (con_curlines >= minheight) && !con_startup) if ((con_curlines >= (minheight-charheight)) && !con_startup)
CON_DrawInput(); CON_DrawInput();
} }
@ -1875,6 +1888,10 @@ void CON_Drawer(void)
CON_ClearHUD(); CON_ClearHUD();
} }
// console movement
if (con_curlines != con_destlines)
CON_MoveConsole();
if (con_curlines > 0) if (con_curlines > 0)
CON_DrawConsole(); CON_DrawConsole();
else if (CON_GamestateDrawHudLines() == true) else if (CON_GamestateDrawHudLines() == true)

View file

@ -2775,20 +2775,36 @@ void CL_ClearPlayer(INT32 playernum)
K_RemoveFollower(&players[playernum]); K_RemoveFollower(&players[playernum]);
} }
if (players[playernum].mo) #define PlayerPointerRemove(field) \
{ if (field) \
P_RemoveMobj(players[playernum].mo); { \
P_SetTarget(&players[playernum].mo, NULL); P_RemoveMobj(field); \
P_SetTarget(&field, NULL); \
} }
// These are mostly subservient to the player, and may not clean themselves up.
PlayerPointerRemove(players[playernum].mo);
PlayerPointerRemove(players[playernum].followmobj);
PlayerPointerRemove(players[playernum].stumbleIndicator);
PlayerPointerRemove(players[playernum].sliptideZipIndicator);
#undef PlayerPointerRemove
// These have thinkers of their own.
P_SetTarget(&players[playernum].whip, NULL);
P_SetTarget(&players[playernum].hand, NULL);
P_SetTarget(&players[playernum].hoverhyudoro, NULL);
P_SetTarget(&players[playernum].ringShooter, NULL);
// TODO: Any better handling in store?
P_SetTarget(&players[playernum].flickyAttacker, NULL);
P_SetTarget(&players[playernum].powerup.flickyController, NULL);
// These are camera items and possibly belong to multiple players.
P_SetTarget(&players[playernum].skybox.viewpoint, NULL); P_SetTarget(&players[playernum].skybox.viewpoint, NULL);
P_SetTarget(&players[playernum].skybox.centerpoint, NULL); P_SetTarget(&players[playernum].skybox.centerpoint, NULL);
P_SetTarget(&players[playernum].awayview.mobj, NULL); P_SetTarget(&players[playernum].awayview.mobj, NULL);
P_SetTarget(&players[playernum].followmobj, NULL);
P_SetTarget(&players[playernum].hoverhyudoro, NULL);
P_SetTarget(&players[playernum].stumbleIndicator, NULL);
P_SetTarget(&players[playernum].sliptideZipIndicator, NULL);
P_SetTarget(&players[playernum].ringShooter, NULL);
} }
// Handle parties. // Handle parties.
@ -4192,9 +4208,15 @@ boolean SV_SpawnServer(void)
serverrunning = true; serverrunning = true;
SV_ResetServer(); SV_ResetServer();
SV_GenContext(); SV_GenContext();
if (netgame && I_NetOpenSocket) if (netgame)
{ {
I_NetOpenSocket(); if (I_NetOpenSocket)
{
I_NetOpenSocket();
}
ourIP = 0;
STUN_bind(GotOurIP);
} }
// non dedicated server just connect to itself // non dedicated server just connect to itself
@ -4203,9 +4225,7 @@ boolean SV_SpawnServer(void)
else doomcom->numslots = 1; else doomcom->numslots = 1;
} }
ourIP = 0;
if (netgame && server)
STUN_bind(GotOurIP);
// strictly speaking, i'm not convinced the following is necessary // strictly speaking, i'm not convinced the following is necessary
// but I'm not confident enough to remove it entirely in case it breaks something // but I'm not confident enough to remove it entirely in case it breaks something

View file

@ -430,7 +430,7 @@ static CV_PossibleValue_t kartbot_cons_t[] = {
{13,"Lv.MAX"}, {13,"Lv.MAX"},
{0, NULL} {0, NULL}
}; };
consvar_t cv_kartbot = CVAR_INIT ("bots", "0", CV_NETVAR, kartbot_cons_t, NULL); consvar_t cv_kartbot = CVAR_INIT ("bots", "Off", CV_NETVAR, kartbot_cons_t, NULL);
consvar_t cv_karteliminatelast = CVAR_INIT ("eliminatelast", "Yes", CV_NETVAR|CV_CALL, CV_YesNo, KartEliminateLast_OnChange); consvar_t cv_karteliminatelast = CVAR_INIT ("eliminatelast", "Yes", CV_NETVAR|CV_CALL, CV_YesNo, KartEliminateLast_OnChange);
@ -1497,9 +1497,9 @@ static void SendNameAndColor(const UINT8 n)
UINT16 sendFollowerColor = cv_followercolor[n].value; UINT16 sendFollowerColor = cv_followercolor[n].value;
// don't allow inaccessible colors // don't allow inaccessible colors
if (sendColor != SKINCOLOR_NONE && K_ColorUsable(sendColor, false) == false) if (sendColor != SKINCOLOR_NONE && K_ColorUsable(sendColor, false, true) == false)
{ {
if (player->skincolor && K_ColorUsable(player->skincolor, false) == true) if (player->skincolor && K_ColorUsable(player->skincolor, false, true) == true)
{ {
// Use our previous color // Use our previous color
CV_StealthSetValue(&cv_playercolor[n], player->skincolor); CV_StealthSetValue(&cv_playercolor[n], player->skincolor);
@ -1514,7 +1514,7 @@ static void SendNameAndColor(const UINT8 n)
} }
// ditto for follower colour: // ditto for follower colour:
if (sendFollowerColor != SKINCOLOR_NONE && K_ColorUsable(sendFollowerColor, true) == false) if (sendFollowerColor != SKINCOLOR_NONE && K_ColorUsable(sendFollowerColor, true, true) == false)
{ {
CV_StealthSet(&cv_followercolor[n], "Default"); // set it to "Default". I don't care about your stupidity! CV_StealthSet(&cv_followercolor[n], "Default"); // set it to "Default". I don't care about your stupidity!
sendFollowerColor = cv_followercolor[n].value; sendFollowerColor = cv_followercolor[n].value;
@ -1724,7 +1724,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
boolean kick = false; boolean kick = false;
// don't allow inaccessible colors // don't allow inaccessible colors
if (K_ColorUsable(p->skincolor, false) == false) if (K_ColorUsable(p->skincolor, false, false) == false)
{ {
kick = true; kick = true;
} }
@ -6829,7 +6829,7 @@ static void Color_OnChange(const UINT8 p)
I_Assert(p < MAXSPLITSCREENPLAYERS); I_Assert(p < MAXSPLITSCREENPLAYERS);
UINT16 color = cv_playercolor[p].value; UINT16 color = cv_playercolor[p].value;
boolean colorisgood = (color == SKINCOLOR_NONE || K_ColorUsable(color, false) == true); boolean colorisgood = (color == SKINCOLOR_NONE || K_ColorUsable(color, false, true) == true);
if (Playing() && splitscreen < p) if (Playing() && splitscreen < p)
{ {

View file

@ -6577,6 +6577,7 @@ struct int_const_s const INT_CONST[] = {
{"DMG_KARMA",DMG_KARMA}, {"DMG_KARMA",DMG_KARMA},
{"DMG_VOLTAGE",DMG_VOLTAGE}, {"DMG_VOLTAGE",DMG_VOLTAGE},
{"DMG_STUMBLE",DMG_STUMBLE}, {"DMG_STUMBLE",DMG_STUMBLE},
{"DMG_WHUMBLE",DMG_WHUMBLE},
//// Death types //// Death types
{"DMG_INSTAKILL",DMG_INSTAKILL}, {"DMG_INSTAKILL",DMG_INSTAKILL},
{"DMG_DEATHPIT",DMG_DEATHPIT}, {"DMG_DEATHPIT",DMG_DEATHPIT},

View file

@ -2455,10 +2455,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
INT32 followerskin; INT32 followerskin;
UINT16 followercolor; UINT16 followercolor;
mobj_t *follower; // old follower, will probably be removed by the time we're dead but you never know. mobj_t *ringShooter, *hoverhyudoro;
mobj_t *hoverhyudoro; mobj_t *skyboxviewpoint, *skyboxcenterpoint;
mobj_t *skyboxviewpoint;
mobj_t *skyboxcenterpoint;
INT32 charflags; INT32 charflags;
UINT32 followitem; UINT32 followitem;
@ -2677,22 +2675,40 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
if (!betweenmaps) if (!betweenmaps)
{ {
follower = players[player].follower; K_RemoveFollower(&players[player]);
P_SetTarget(&players[player].follower, NULL);
P_SetTarget(&players[player].awayview.mobj, NULL); #define PlayerPointerRemove(field) \
P_SetTarget(&players[player].stumbleIndicator, NULL); if (field) \
{ \
P_RemoveMobj(field); \
P_SetTarget(&field, NULL); \
}
// These are mostly subservient to the player, and may not clean themselves up.
PlayerPointerRemove(players[player].followmobj);
PlayerPointerRemove(players[player].stumbleIndicator);
PlayerPointerRemove(players[player].sliptideZipIndicator);
#undef PlayerPointerRemove
// These will erase themselves.
P_SetTarget(&players[player].whip, NULL); P_SetTarget(&players[player].whip, NULL);
P_SetTarget(&players[player].hand, NULL); P_SetTarget(&players[player].hand, NULL);
P_SetTarget(&players[player].ringShooter, NULL);
P_SetTarget(&players[player].followmobj, NULL);
// TODO: Any better handling in store?
P_SetTarget(&players[player].awayview.mobj, NULL);
P_SetTarget(&players[player].flickyAttacker, NULL);
P_SetTarget(&players[player].powerup.flickyController, NULL);
// The following pointers are safe to set directly, because the end goal should be refcount consistency before and after remanifestation.
ringShooter = players[player].ringShooter;
hoverhyudoro = players[player].hoverhyudoro; hoverhyudoro = players[player].hoverhyudoro;
skyboxviewpoint = players[player].skybox.viewpoint; skyboxviewpoint = players[player].skybox.viewpoint;
skyboxcenterpoint = players[player].skybox.centerpoint; skyboxcenterpoint = players[player].skybox.centerpoint;
} }
else else
{ {
follower = hoverhyudoro = NULL; ringShooter = hoverhyudoro = NULL;
skyboxviewpoint = skyboxcenterpoint = NULL; skyboxviewpoint = skyboxcenterpoint = NULL;
} }
@ -2769,9 +2785,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
if (saveroundconditions) if (saveroundconditions)
memcpy(&p->roundconditions, &roundconditions, sizeof (p->roundconditions)); memcpy(&p->roundconditions, &roundconditions, sizeof (p->roundconditions));
if (follower) // See above comment about refcount consistency.
P_RemoveMobj(follower); p->ringShooter = ringShooter;
p->hoverhyudoro = hoverhyudoro; p->hoverhyudoro = hoverhyudoro;
p->skybox.viewpoint = skyboxviewpoint; p->skybox.viewpoint = skyboxviewpoint;
p->skybox.centerpoint = skyboxcenterpoint; p->skybox.centerpoint = skyboxcenterpoint;

View file

@ -888,7 +888,7 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
// while still behaving as if it's a "real" hit. // while still behaving as if it's a "real" hit.
P_PlayRinglossSound(victim); P_PlayRinglossSound(victim);
P_PlayerRingBurst(victimPlayer, 5); P_PlayerRingBurst(victimPlayer, 5);
P_DamageMobj(victim, shield, attacker, 1, DMG_STUMBLE); // There's a special exception in P_DamageMobj for type==MT_INSTAWHIP P_DamageMobj(victim, shield, attacker, 1, DMG_WHUMBLE);
K_DropPowerUps(victimPlayer); K_DropPowerUps(victimPlayer);

View file

@ -217,11 +217,11 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
} }
/*-------------------------------------------------- /*--------------------------------------------------
boolean K_ColorUsable(skincolornum_t color, boolean follower) boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked)
See header file for description. See header file for description.
--------------------------------------------------*/ --------------------------------------------------*/
boolean K_ColorUsable(skincolornum_t color, boolean follower) boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked)
{ {
INT32 i = MAXUNLOCKABLES; INT32 i = MAXUNLOCKABLES;
@ -237,7 +237,7 @@ boolean K_ColorUsable(skincolornum_t color, boolean follower)
return false; return false;
} }
if (demo.playback) if (demo.playback || !locked)
{ {
// Simplifies things elsewhere... // Simplifies things elsewhere...
return true; return true;

View file

@ -117,7 +117,7 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
/*-------------------------------------------------- /*--------------------------------------------------
boolean K_ColorUsable(skincolornum_t color, skin_t *skin, follower_t *follower); boolean K_ColorUsable(skincolornum_t color, skin_t *skin, follower_t *follower, boolean locked);
Determines whenever or not we meet the unlockable conditions Determines whenever or not we meet the unlockable conditions
to use a certain color. to use a certain color.
@ -125,12 +125,13 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
Input Arguments:- Input Arguments:-
color - Color we want to use. color - Color we want to use.
follower - Set to include the special follower-only color options. follower - Set to include the special follower-only color options.
locked - use local player's unlocks.
Return:- Return:-
true if we can use it, otherwise false. true if we can use it, otherwise false.
--------------------------------------------------*/ --------------------------------------------------*/
boolean K_ColorUsable(skincolornum_t color, boolean follower); boolean K_ColorUsable(skincolornum_t color, boolean follower, boolean locked);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -722,7 +722,7 @@ void K_FollowerHornTaunt(player_t *taunter, player_t *victim)
|| victim == NULL || victim == NULL
|| taunter->followerskin < 0 || taunter->followerskin < 0
|| taunter->followerskin >= numfollowers || taunter->followerskin >= numfollowers
|| (P_IsLocalPlayer(victim) == false && cv_karthorns.value != 2) || (P_IsDisplayPlayer(victim) == false && cv_karthorns.value != 2)
|| P_MobjWasRemoved(taunter->mo) == true || P_MobjWasRemoved(taunter->mo) == true
|| P_MobjWasRemoved(taunter->follower) == true || P_MobjWasRemoved(taunter->follower) == true
) )

View file

@ -3994,8 +3994,6 @@ static void K_drawKartMinimap(void)
if (doprogressionbar == false) if (doprogressionbar == false)
{ {
angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle);
interpx = R_InterpolateFixed(mobj->old_x, mobj->x); interpx = R_InterpolateFixed(mobj->old_x, mobj->x);
interpy = R_InterpolateFixed(mobj->old_y, mobj->y); interpy = R_InterpolateFixed(mobj->old_y, mobj->y);
@ -4010,6 +4008,10 @@ static void K_drawKartMinimap(void)
if (!nocontest) if (!nocontest)
{ {
angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle);
if (encoremode)
ang = ANGLE_180 - ang;
K_drawKartMinimapIcon( K_drawKartMinimapIcon(
interpx, interpx,
interpy, interpy,
@ -4198,8 +4200,6 @@ static void K_drawKartMinimap(void)
if (doprogressionbar == false) if (doprogressionbar == false)
{ {
angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle);
interpx = R_InterpolateFixed(mobj->old_x, mobj->x); interpx = R_InterpolateFixed(mobj->old_x, mobj->x);
interpy = R_InterpolateFixed(mobj->old_y, mobj->y); interpy = R_InterpolateFixed(mobj->old_y, mobj->y);
@ -4214,6 +4214,10 @@ static void K_drawKartMinimap(void)
if (!nocontest) if (!nocontest)
{ {
angle_t ang = R_InterpolateAngle(mobj->old_angle, mobj->angle);
if (encoremode)
ang = ANGLE_180 - ang;
K_drawKartMinimapIcon( K_drawKartMinimapIcon(
interpx, interpx,
interpy, interpy,

View file

@ -8068,9 +8068,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->guardCooldown) if (player->guardCooldown)
player->guardCooldown--; player->guardCooldown--;
if (player->whip && P_MobjWasRemoved(player->whip))
P_SetTarget(&player->whip, NULL);
if (player->startboost > 0 && onground == true) if (player->startboost > 0 && onground == true)
{ {
player->startboost--; player->startboost--;
@ -8328,20 +8325,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->tripwireState = TRIPSTATE_NONE; player->tripwireState = TRIPSTATE_NONE;
} }
if (player->hand && P_MobjWasRemoved(player->hand))
P_SetTarget(&player->hand, NULL);
if (player->flickyAttacker && P_MobjWasRemoved(player->flickyAttacker))
P_SetTarget(&player->flickyAttacker, NULL);
if (player->powerup.flickyController && P_MobjWasRemoved(player->powerup.flickyController))
P_SetTarget(&player->powerup.flickyController, NULL);
if (player->spectator == false) if (player->spectator == false)
{ {
K_KartEbrakeVisuals(player); K_KartEbrakeVisuals(player);
Obj_ServantHandHandling(player); Obj_ServantHandSpawning(player);
} }
if (K_GetKartButtons(player) & BT_BRAKE && if (K_GetKartButtons(player) & BT_BRAKE &&

View file

@ -144,7 +144,8 @@ void Obj_GachaBomReboundThink(mobj_t *mobj);
void Obj_SpawnGachaBomRebound(mobj_t *source, mobj_t *target); void Obj_SpawnGachaBomRebound(mobj_t *source, mobj_t *target);
/* Servant Hand */ /* Servant Hand */
void Obj_ServantHandHandling(player_t *player); void Obj_ServantHandSpawning(player_t *player);
void Obj_ServantHandThink(mobj_t *hand);
void Obj_PointPlayersToXY(fixed_t x, fixed_t y); void Obj_PointPlayersToXY(fixed_t x, fixed_t y);
/* Super Flicky Controller */ /* Super Flicky Controller */

View file

@ -373,7 +373,7 @@ void PR_LoadProfiles(void)
; // Valid, even outside the bounds ; // Valid, even outside the bounds
} }
else if (profilesList[i]->color >= numskincolors else if (profilesList[i]->color >= numskincolors
|| K_ColorUsable(profilesList[i]->color, false) == false) || K_ColorUsable(profilesList[i]->color, false, false) == false)
{ {
profilesList[i]->color = PROFILEDEFAULTCOLOR; profilesList[i]->color = PROFILEDEFAULTCOLOR;
} }
@ -383,13 +383,13 @@ void PR_LoadProfiles(void)
profilesList[i]->followercolor = READUINT16(save.p); profilesList[i]->followercolor = READUINT16(save.p);
if (profilesList[i]->followercolor == FOLLOWERCOLOR_MATCH if (profilesList[i]->followercolor == FOLLOWERCOLOR_MATCH
|| profilesList[i]->followercolor == FOLLOWERCOLOR_OPPOSITE) || profilesList[i]->followercolor == FOLLOWERCOLOR_OPPOSITE
|| profilesList[i]->followercolor == SKINCOLOR_NONE)
{ {
; // Valid, even outside the bounds ; // Valid, even outside the bounds
} }
else if (profilesList[i]->followercolor >= numskincolors else if (profilesList[i]->followercolor >= numskincolors
|| profilesList[i]->followercolor == SKINCOLOR_NONE || K_ColorUsable(profilesList[i]->followercolor, true, false) == false)
|| K_ColorUsable(profilesList[i]->followercolor, true) == false)
{ {
profilesList[i]->followercolor = PROFILEDEFAULTFOLLOWERCOLOR; profilesList[i]->followercolor = PROFILEDEFAULTFOLLOWERCOLOR;
} }

View file

@ -341,7 +341,7 @@ static int lib_cvRegisterVar(lua_State *L)
} else if (i == 4 || (k && fasticmp(k, "PossibleValue"))) { } else if (i == 4 || (k && fasticmp(k, "PossibleValue"))) {
if (lua_islightuserdata(L, 4)) { if (lua_islightuserdata(L, 4)) {
CV_PossibleValue_t *pv = lua_touserdata(L, 4); CV_PossibleValue_t *pv = lua_touserdata(L, 4);
if (pv == CV_OnOff || pv == CV_YesNo || pv == CV_Unsigned || pv == CV_Natural) if (pv == CV_OnOff || pv == CV_YesNo || pv == CV_Unsigned || pv == CV_Natural || pv == CV_TrueFalse)
cvar->PossibleValue = pv; cvar->PossibleValue = pv;
else else
FIELDERROR("PossibleValue", "CV_PossibleValue_t expected, got unrecognised pointer") FIELDERROR("PossibleValue", "CV_PossibleValue_t expected, got unrecognised pointer")
@ -577,6 +577,8 @@ int LUA_ConsoleLib(lua_State *L)
lua_setglobal(L, "CV_Unsigned"); lua_setglobal(L, "CV_Unsigned");
lua_pushlightuserdata(L, CV_Natural); lua_pushlightuserdata(L, CV_Natural);
lua_setglobal(L, "CV_Natural"); lua_setglobal(L, "CV_Natural");
lua_pushlightuserdata(L, CV_TrueFalse);
lua_setglobal(L, "CV_TrueFalse");
// Set global functions // Set global functions
lua_pushvalue(L, LUA_GLOBALSINDEX); lua_pushvalue(L, LUA_GLOBALSINDEX);

View file

@ -409,8 +409,12 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->trickboostdecay); lua_pushinteger(L, plr->trickboostdecay);
else if (fastcmp(field,"trickboost")) else if (fastcmp(field,"trickboost"))
lua_pushinteger(L, plr->trickboost); lua_pushinteger(L, plr->trickboost);
else if (fastcmp(field,"dashRingPullTics"))
lua_pushinteger(L, plr->dashRingPullTics);
else if (fastcmp(field,"dashRingPushTics"))
lua_pushinteger(L, plr->dashRingPushTics);
else if (fastcmp(field,"roundscore")) else if (fastcmp(field,"roundscore"))
plr->roundscore = luaL_checkinteger(L, 3); lua_pushinteger(L, plr->roundscore);
else if (fastcmp(field,"emeralds")) else if (fastcmp(field,"emeralds"))
lua_pushinteger(L, plr->emeralds); lua_pushinteger(L, plr->emeralds);
else if (fastcmp(field,"karmadelay")) else if (fastcmp(field,"karmadelay"))
@ -813,8 +817,12 @@ static int player_set(lua_State *L)
plr->trickboostdecay = luaL_checkinteger(L, 3); plr->trickboostdecay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickboost")) else if (fastcmp(field,"trickboost"))
plr->trickboost = luaL_checkinteger(L, 3); plr->trickboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashRingPullTics"))
plr->dashRingPullTics = luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashRingPushTics"))
plr->dashRingPushTics = luaL_checkinteger(L, 3);
else if (fastcmp(field,"roundscore")) else if (fastcmp(field,"roundscore"))
lua_pushinteger(L, plr->roundscore); plr->roundscore = luaL_checkinteger(L, 3);
else if (fastcmp(field,"emeralds")) else if (fastcmp(field,"emeralds"))
plr->emeralds = luaL_checkinteger(L, 3); plr->emeralds = luaL_checkinteger(L, 3);
else if (fastcmp(field,"karmadelay")) else if (fastcmp(field,"karmadelay"))

View file

@ -150,7 +150,7 @@ static void M_NewPlayerColors(setup_player_t *p)
// Add all unlocked colors // Add all unlocked colors
for (i = SKINCOLOR_NONE+1; i < numskincolors; i++) for (i = SKINCOLOR_NONE+1; i < numskincolors; i++)
{ {
if (K_ColorUsable(i, follower) == true) if (K_ColorUsable(i, follower, true) == true)
{ {
M_PushMenuColor(&p->colors, i); M_PushMenuColor(&p->colors, i);
} }

View file

@ -63,8 +63,11 @@ static void RemoveRingShooterPointer(mobj_t *base)
} }
// NULL the player's pointer. // NULL the player's pointer.
player = &players[ rs_base_playerid(base) ]; if (playeringame[ rs_base_playerid(base) ])
P_SetTarget(&player->ringShooter, NULL); {
player = &players[ rs_base_playerid(base) ];
P_SetTarget(&player->ringShooter, NULL);
}
// Remove our player ID // Remove our player ID
rs_base_playerid(base) = -1; rs_base_playerid(base) = -1;

View file

@ -8,7 +8,7 @@
#include "../r_main.h" #include "../r_main.h"
#include "../g_game.h" #include "../g_game.h"
void Obj_ServantHandHandling(player_t *player) void Obj_ServantHandSpawning(player_t *player)
{ {
if (player->pflags & PF_WRONGWAY || player->pflags & PF_POINTME) if (player->pflags & PF_WRONGWAY || player->pflags & PF_POINTME)
{ {
@ -36,71 +36,86 @@ void Obj_ServantHandHandling(player_t *player)
} }
} }
} }
if (player->hand)
{
player->hand->destscale = mapobjectscale;
}
} }
else if (player->handtimer != 0) else if (player->handtimer != 0)
{ {
player->handtimer--; player->handtimer--;
} }
}
void Obj_ServantHandThink(mobj_t *hand)
{
UINT8 handtimer = 0;
player_t *player = NULL;
if (P_MobjWasRemoved(hand->target))
{
P_RemoveMobj(hand);
return;
}
if (hand->target->health && hand->target->player && hand->target->player->hand == hand)
{
player = hand->target->player;
handtimer = hand->target->player->handtimer;
}
if (player->hand)
{ {
const fixed_t handpokespeed = 4; const fixed_t handpokespeed = 4;
const fixed_t looping = handpokespeed - abs((player->hand->threshold % (handpokespeed*2)) - handpokespeed); const fixed_t looping = handpokespeed - abs((hand->threshold % (handpokespeed*2)) - handpokespeed);
fixed_t xoffs = 0, yoffs = 0; fixed_t xoffs = 0, yoffs = 0;
player->hand->color = player->skincolor; if (hand->fuse != 0)
player->hand->angle = player->besthanddirection;
if (player->hand->fuse != 0)
{ {
; ;
} }
else if (looping != 0) else if (looping != 0)
{ {
xoffs = FixedMul(2 * looping * mapobjectscale, FINECOSINE(player->hand->angle >> ANGLETOFINESHIFT)), xoffs = FixedMul(2 * looping * mapobjectscale, FINECOSINE(hand->angle >> ANGLETOFINESHIFT)),
yoffs = FixedMul(2 * looping * mapobjectscale, FINESINE(player->hand->angle >> ANGLETOFINESHIFT)), yoffs = FixedMul(2 * looping * mapobjectscale, FINESINE(hand->angle >> ANGLETOFINESHIFT)),
player->hand->threshold++; hand->threshold++;
} }
else if (player->handtimer == 0) else if (handtimer == 0)
{ {
player->hand->fuse = 8; hand->fuse = 8;
} }
else else
{ {
player->hand->threshold++; hand->threshold++;
} }
if (player->hand->fuse != 0) if (hand->fuse != 0)
{ {
if ((player->hand->fuse > 4) ^ (player->handtimer < TICRATE/2)) if ((hand->fuse > 4) ^ (handtimer < TICRATE/2))
{ {
player->hand->spritexscale = FRACUNIT/3; hand->spritexscale = FRACUNIT/3;
player->hand->spriteyscale = 3*FRACUNIT; hand->spriteyscale = 3*FRACUNIT;
} }
else else
{ {
player->hand->spritexscale = 2*FRACUNIT; hand->spritexscale = 2*FRACUNIT;
player->hand->spriteyscale = FRACUNIT/2; hand->spriteyscale = FRACUNIT/2;
} }
} }
P_MoveOrigin(player->hand, if (player != NULL)
player->mo->x + xoffs, {
player->mo->y + yoffs, hand->color = player->skincolor;
player->mo->z + player->mo->height + 30*mapobjectscale hand->angle = player->besthanddirection;
);
K_FlipFromObject(player->hand, player->mo);
player->hand->sprzoff = player->mo->sprzoff; P_MoveOrigin(hand,
player->mo->x + xoffs,
player->mo->y + yoffs,
player->mo->z + player->mo->height + 30*mapobjectscale
);
K_FlipFromObject(hand, player->mo);
player->hand->renderflags &= ~RF_DONTDRAW; hand->sprzoff = player->mo->sprzoff;
player->hand->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
hand->renderflags &= ~RF_DONTDRAW;
hand->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
}
} }
} }

View file

@ -2331,7 +2331,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
invincible = false; invincible = false;
} }
if (invincible && type != DMG_STUMBLE) if (invincible && type != DMG_STUMBLE && type != DMG_WHUMBLE)
{ {
const INT32 oldHitlag = target->hitlag; const INT32 oldHitlag = target->hitlag;
const INT32 oldHitlagInflictor = inflictor ? inflictor->hitlag : 0; const INT32 oldHitlagInflictor = inflictor ? inflictor->hitlag : 0;
@ -2389,7 +2389,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
{ {
// Check if we should allow wombo combos (hard hits by default, inverted by the presence of DMG_WOMBO). // Check if we should allow wombo combos (hard hits by default, inverted by the presence of DMG_WOMBO).
boolean allowcombo = ((hardhit || (type == DMG_STUMBLE)) == !(damagetype & DMG_WOMBO)); boolean allowcombo = ((hardhit || (type == DMG_STUMBLE || type == DMG_WHUMBLE)) == !(damagetype & DMG_WOMBO));
// Tumble/stumble is a special case. // Tumble/stumble is a special case.
if (type == DMG_TUMBLE) if (type == DMG_TUMBLE)
@ -2398,11 +2398,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (player->tumbleBounces == 1 && (P_MobjFlip(target)*target->momz > 0)) if (player->tumbleBounces == 1 && (P_MobjFlip(target)*target->momz > 0))
allowcombo = false; allowcombo = false;
} }
else if (type == DMG_STUMBLE) else if (type == DMG_STUMBLE || type == DMG_WHUMBLE)
{ {
// don't allow constant combo // don't allow constant combo
if (player->tumbleBounces == TUMBLEBOUNCES-1 && (P_MobjFlip(target)*target->momz > 0)) if (player->tumbleBounces == TUMBLEBOUNCES-1 && (P_MobjFlip(target)*target->momz > 0))
{
if (type == DMG_STUMBLE)
return false; // No-sell strings of stumble
allowcombo = false; allowcombo = false;
}
} }
if (allowcombo == false && (target->eflags & MFE_PAUSED)) if (allowcombo == false && (target->eflags & MFE_PAUSED))
@ -2411,7 +2416,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
} }
// DMG_EXPLODE excluded from flashtic checks to prevent dodging eggbox/SPB with weak spinout // DMG_EXPLODE excluded from flashtic checks to prevent dodging eggbox/SPB with weak spinout
if ((target->hitlag == 0 || allowcombo == false) && player->flashing > 0 && type != DMG_EXPLODE && type != DMG_STUMBLE) if ((target->hitlag == 0 || allowcombo == false) && player->flashing > 0 && type != DMG_EXPLODE && type != DMG_STUMBLE && type != DMG_WHUMBLE)
{ {
// Post-hit invincibility // Post-hit invincibility
K_DoInstashield(player); K_DoInstashield(player);
@ -2439,9 +2444,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
damage = 0; damage = 0;
} }
// Instawhip breaks the rules and does "damaging stumble", // Sting and stumble shouldn't be rewarding Battle hits.
// but sting and stumble shouldn't be rewarding Battle hits otherwise. if (type == DMG_STING || type == DMG_STUMBLE)
if ((type == DMG_STING || type == DMG_STUMBLE) && !(inflictor && inflictor->type == MT_INSTAWHIP))
{ {
damage = 0; damage = 0;
} }
@ -2537,6 +2541,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
ringburst = 0; ringburst = 0;
break; break;
case DMG_STUMBLE: case DMG_STUMBLE:
case DMG_WHUMBLE:
K_StumblePlayer(player); K_StumblePlayer(player);
ringburst = 0; ringburst = 0;
break; break;
@ -2559,7 +2564,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
break; break;
} }
if (type != DMG_STUMBLE) if (type != DMG_STUMBLE && type != DMG_WHUMBLE)
{ {
if (type != DMG_STING) if (type != DMG_STING)
player->flashing = K_GetKartFlashing(player); player->flashing = K_GetKartFlashing(player);

View file

@ -544,6 +544,7 @@ struct BasicFF_t
#define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest #define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest
#define DMG_VOLTAGE 0x06 #define DMG_VOLTAGE 0x06
#define DMG_STUMBLE 0x07 #define DMG_STUMBLE 0x07
#define DMG_WHUMBLE 0x08
//// Death types - cannot be combined with damage types //// Death types - cannot be combined with damage types
#define DMG_INSTAKILL 0x80 #define DMG_INSTAKILL 0x80
#define DMG_DEATHPIT 0x81 #define DMG_DEATHPIT 0x81

View file

@ -7385,6 +7385,13 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
Obj_MantaRingThink(mobj); Obj_MantaRingThink(mobj);
break; break;
} }
case MT_SERVANTHAND:
{
Obj_ServantHandThink(mobj);
if (P_MobjWasRemoved(mobj))
return false;
break;
}
case MT_BALLHOG: case MT_BALLHOG:
{ {
mobj_t *ghost = P_SpawnGhostMobj(mobj); mobj_t *ghost = P_SpawnGhostMobj(mobj);
@ -9839,10 +9846,11 @@ static boolean P_FuseThink(mobj_t *mobj)
} }
case MT_SERVANTHAND: case MT_SERVANTHAND:
{ {
if (!mobj->target if (P_MobjWasRemoved(mobj->target)
|| P_MobjWasRemoved(mobj->target) || !mobj->target->health
|| !mobj->target->player || !mobj->target->player
|| mobj->target->player->handtimer == 0) || mobj->target->player->handtimer == 0
|| mobj->target->player->hand != mobj)
{ {
P_RemoveMobj(mobj); P_RemoveMobj(mobj);
return false; return false;
@ -13811,8 +13819,15 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
y + FixedMul(length, FINESINE(fineangle)), y + FixedMul(length, FINESINE(fineangle)),
z, MT_LOOPCENTERPOINT); z, MT_LOOPCENTERPOINT);
if (!P_MobjWasRemoved(loopanchor)) if (P_MobjWasRemoved(loopanchor))
Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]); {
// No recovery.
return;
}
loopanchor->spawnpoint = NULL;
Obj_LinkLoopAnchor(loopanchor, loopcenter, mthing->args[0]);
} }
for (r = 0; r < numitems; r++) for (r = 0; r < numitems; r++)
@ -13832,15 +13847,15 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numi
if (!inclusive) if (!inclusive)
mobj = P_SpawnMobjFromMapThing(&dummything, x, y, z, itemtype); mobj = P_SpawnMobjFromMapThing(&dummything, x, y, z, itemtype);
if (!mobj) if (P_MobjWasRemoved(mobj))
continue; continue;
if (isloopend)
{
Obj_InitLoopEndpoint(mobj, loopanchor);
}
mobj->spawnpoint = NULL; mobj->spawnpoint = NULL;
if (!isloopend)
continue;
Obj_InitLoopEndpoint(mobj, loopanchor);
} }
} }
@ -13898,11 +13913,12 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
mobj = P_SpawnMobjFromMapThing(&dummything, x + v[0], y + v[1], z + v[2], itemtype); mobj = P_SpawnMobjFromMapThing(&dummything, x + v[0], y + v[1], z + v[2], itemtype);
if (!mobj) if (P_MobjWasRemoved(mobj))
continue; continue;
mobj->z -= mobj->height/2;
mobj->spawnpoint = NULL; mobj->spawnpoint = NULL;
mobj->z -= mobj->height/2;
} }
} }

View file

@ -500,6 +500,9 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT8(save->p, players[i].trickboostdecay); WRITEUINT8(save->p, players[i].trickboostdecay);
WRITEUINT8(save->p, players[i].trickboost); WRITEUINT8(save->p, players[i].trickboost);
WRITEUINT8(save->p, players[i].dashRingPullTics);
WRITEUINT8(save->p, players[i].dashRingPushTics);
WRITEUINT32(save->p, players[i].ebrakefor); WRITEUINT32(save->p, players[i].ebrakefor);
WRITEUINT32(save->p, players[i].roundscore); WRITEUINT32(save->p, players[i].roundscore);
@ -918,6 +921,9 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].trickboostdecay = READUINT8(save->p); players[i].trickboostdecay = READUINT8(save->p);
players[i].trickboost = READUINT8(save->p); players[i].trickboost = READUINT8(save->p);
players[i].dashRingPullTics = READUINT8(save->p);
players[i].dashRingPushTics = READUINT8(save->p);
players[i].ebrakefor = READUINT32(save->p); players[i].ebrakefor = READUINT32(save->p);
players[i].roundscore = READUINT32(save->p); players[i].roundscore = READUINT32(save->p);
@ -4074,7 +4080,10 @@ static thinker_t* LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
if (diff2 & MD2_RENDERFLAGS) if (diff2 & MD2_RENDERFLAGS)
mobj->renderflags = READUINT32(save->p); mobj->renderflags = READUINT32(save->p);
if (diff2 & MD2_TID) if (diff2 & MD2_TID)
P_SetThingTID(mobj, READINT16(save->p)); {
INT16 tid = READINT16(save->p);
P_SetThingTID(mobj, tid);
}
if (diff2 & MD2_SPRITESCALE) if (diff2 & MD2_SPRITESCALE)
{ {
mobj->spritexscale = READFIXED(save->p); mobj->spritexscale = READFIXED(save->p);

View file

@ -4249,6 +4249,25 @@ void P_PlayerThink(player_t *player)
player->playerstate = PST_DEAD; player->playerstate = PST_DEAD;
} }
// Erasing invalid player pointers
{
#define PlayerPointerErase(field) \
if (field && P_MobjWasRemoved(field)) \
P_SetTarget(&field, NULL); \
PlayerPointerErase(player->followmobj);
PlayerPointerErase(player->stumbleIndicator);
PlayerPointerErase(player->sliptideZipIndicator);
PlayerPointerErase(player->whip);
PlayerPointerErase(player->hand);
PlayerPointerErase(player->ringShooter);
PlayerPointerErase(player->hoverhyudoro);
PlayerPointerErase(player->flickyAttacker);
PlayerPointerErase(player->powerup.flickyController);
#undef PlayerPointerErase
}
player->old_drawangle = player->drawangle; player->old_drawangle = player->drawangle;
P_TickAltView(&player->awayview); P_TickAltView(&player->awayview);
@ -4302,7 +4321,7 @@ void P_PlayerThink(player_t *player)
else if (player->kickstartaccel < ACCEL_KICKSTART) else if (player->kickstartaccel < ACCEL_KICKSTART)
{ {
player->kickstartaccel++; player->kickstartaccel++;
if ((player->kickstartaccel == ACCEL_KICKSTART) && P_IsLocalPlayer(player)) if ((player->kickstartaccel == ACCEL_KICKSTART) && !K_PlayerUsesBotMovement(player) && P_IsDisplayPlayer(player))
{ {
S_StartSound(NULL, sfx_ding); S_StartSound(NULL, sfx_ding);
} }

View file

@ -1083,8 +1083,6 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
.done(); .done();
} }
#ifdef HWRENDER
// This is now a function since it's otherwise repeated 2 times and honestly looks retarded:
static UINT32 V_GetHWConsBackColor(void) static UINT32 V_GetHWConsBackColor(void)
{ {
UINT32 hwcolor; UINT32 hwcolor;
@ -1095,26 +1093,25 @@ static UINT32 V_GetHWConsBackColor(void)
case 2: hwcolor = 0xdeb88700; break; // Sepia case 2: hwcolor = 0xdeb88700; break; // Sepia
case 3: hwcolor = 0x40201000; break; // Brown case 3: hwcolor = 0x40201000; break; // Brown
case 4: hwcolor = 0xfa807200; break; // Pink case 4: hwcolor = 0xfa807200; break; // Pink
case 5: hwcolor = 0xff69b400; break; // Raspberry case 5: hwcolor = 0xff000000; break; // Red
case 6: hwcolor = 0xff000000; break; // Red case 6: hwcolor = 0xff800000; break; // Orange
case 7: hwcolor = 0xffd68300; break; // Creamsicle case 7: hwcolor = 0xdaa52000; break; // Gold
case 8: hwcolor = 0xff800000; break; // Orange case 8: hwcolor = 0xffdd0000; break; // Yellow
case 9: hwcolor = 0xdaa52000; break; // Gold case 9: hwcolor = 0xc5e80000; break; // Peridot
case 10: hwcolor = 0x80800000; break; // Yellow case 10: hwcolor = 0x00800000; break; // Green
case 11: hwcolor = 0x00ff0000; break; // Emerald case 11: hwcolor = 0x15f2b000; break; // Aquamarine
case 12: hwcolor = 0x00800000; break; // Green case 12: hwcolor = 0x00ffff00; break; // Cyan
case 13: hwcolor = 0x4080ff00; break; // Cyan case 13: hwcolor = 0x4682b400; break; // Steel
case 14: hwcolor = 0x4682b400; break; // Steel case 14: hwcolor = 0x0000ff00; break; // Blue
case 15: hwcolor = 0x1e90ff00; break; // Periwinkle case 15: hwcolor = 0x9844ff00; break; // Purple
case 16: hwcolor = 0x0000ff00; break; // Blue case 16: hwcolor = 0xff00ff00; break; // Magenta
case 17: hwcolor = 0xff00ff00; break; // Purple case 17: hwcolor = 0xee82ee00; break; // Lavender
case 18: hwcolor = 0xee82ee00; break; // Lavender case 18: hwcolor = 0xf570a500; break; // Rose
// Default green // Default green
default: hwcolor = 0x00800000; break; default: hwcolor = 0x00800000; break;
} }
return hwcolor; return hwcolor;
} }
#endif
// THANK YOU MPC!!! // THANK YOU MPC!!!
// and thanks toaster for cleaning it up. // and thanks toaster for cleaning it up.
@ -1674,31 +1671,7 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color)
if (color == INT32_MAX) if (color == INT32_MAX)
color = cons_backcolor.value; color = cons_backcolor.value;
UINT32 hwcolor; UINT32 hwcolor = V_GetHWConsBackColor();
switch (color)
{
case 0: hwcolor = 0xffffff00; break; // White
case 1: hwcolor = 0x00000000; break; // Black // Note this is different from V_DrawFadeConsBack
case 2: hwcolor = 0xdeb88700; break; // Sepia
case 3: hwcolor = 0x40201000; break; // Brown
case 4: hwcolor = 0xfa807200; break; // Pink
case 5: hwcolor = 0xff69b400; break; // Raspberry
case 6: hwcolor = 0xff000000; break; // Red
case 7: hwcolor = 0xffd68300; break; // Creamsicle
case 8: hwcolor = 0xff800000; break; // Orange
case 9: hwcolor = 0xdaa52000; break; // Gold
case 10: hwcolor = 0x80800000; break; // Yellow
case 11: hwcolor = 0x00ff0000; break; // Emerald
case 12: hwcolor = 0x00800000; break; // Green
case 13: hwcolor = 0x4080ff00; break; // Cyan
case 14: hwcolor = 0x4682b400; break; // Steel
case 15: hwcolor = 0x1e90ff00; break; // Periwinkle
case 16: hwcolor = 0x0000ff00; break; // Blue
case 17: hwcolor = 0xff00ff00; break; // Purple
case 18: hwcolor = 0xee82ee00; break; // Lavender
// Default green
default: hwcolor = 0x00800000; break;
}
#ifdef HWRENDER #ifdef HWRENDER
if (rendermode == render_opengl) if (rendermode == render_opengl)