From d272342db7d2ce273a137f5f5a5d076aa5bb7bf3 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 18 Feb 2019 00:17:58 -0500 Subject: [PATCH 01/81] Shrink timer is consistent 20sec --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index b006ae3bb..797fbe24e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3294,7 +3294,7 @@ static void K_DoShrink(player_t *user) players[i].mo->destscale = (6*mapobjectscale)/8; if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot) players[i].mo->destscale = (6*players[i].mo->destscale)/8; - players[i].kartstuff[k_growshrinktimer] = -(200+(40*(MAXPLAYERS-players[i].kartstuff[k_position]))); + players[i].kartstuff[k_growshrinktimer] = -(20*TICRATE); } // Grow should get taken away. From fcb82af3292df5b2e14943288d4f3a1d610c64a4 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 18 Feb 2019 00:23:40 -0500 Subject: [PATCH 02/81] Some items have 30 sec cooldown on match start --- src/k_kart.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 797fbe24e..48f1c93a8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -699,17 +699,19 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) if (mashed > 0) \ odds = FixedDiv(odds<> FRACBITS \ +#define COOLDOWNONSTART (leveltime < (31*TICRATE)+starttime) + switch (item) { case KITEM_INVINCIBILITY: case KITEM_GROW: - if (pinvin >= max(1, (pingame+2) / 4)) + if (pinvin >= max(1, (pingame+2) / 4) || COOLDOWNONSTART) newodds = 0; else - /* FALLTHRU */ + POWERITEMODDS(newodds); + break; case KITEM_ROCKETSNEAKER: case KITEM_JAWZ: - case KITEM_MINE: case KITEM_BALLHOG: case KITEM_THUNDERSHIELD: case KRITEM_TRIPLESNEAKER: @@ -720,17 +722,27 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) case KRITEM_DUALJAWZ: POWERITEMODDS(newodds); break; + case KITEM_MINE: + if (COOLDOWNONSTART) + newodds = 0; + else + POWERITEMODDS(newodds); + break; case KITEM_SPB: - //POWERITEMODDS(newodds); if (((indirectitemcooldown > 0) || (pexiting > 0) || (secondist/distvar < 3)) && (pos != 9)) // Force SPB newodds = 0; else - newodds *= min((secondist/distvar)-4, 3); + newodds *= min((secondist/distvar)-4, 3); // POWERITEMODDS(newodds); break; case KITEM_SHRINK: - POWERITEMODDS(newodds); - if ((indirectitemcooldown > 0) || (pingame-1 <= pexiting)) + if ((indirectitemcooldown > 0) || (pingame-1 <= pexiting) || COOLDOWNONSTART) + newodds = 0; + else + POWERITEMODDS(newodds); + break; + case KITEM_HYUDORO: + if (COOLDOWNONSTART) newodds = 0; break; default: From a31b204cf2d64c46f2be938179614a7a26ae1021 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 18:38:54 -0500 Subject: [PATCH 03/81] Mines can be punted Setting behind leaves a longer startup animation window so that it can be punted more easily --- src/k_kart.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++---- src/k_kart.h | 1 + src/p_map.c | 14 +++++++++-- src/p_mobj.c | 23 ++++++++++++++----- 4 files changed, 91 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 48f1c93a8..855e09034 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2895,7 +2895,8 @@ static mobj_t *K_FindLastTrailMobj(player_t *player) static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, INT32 altthrow) { mobj_t *mo; - INT32 dir, PROJSPEED; + INT32 dir; + fixed_t PROJSPEED; angle_t newangle; fixed_t newx, newy, newz; mobj_t *throwmo; @@ -3012,10 +3013,10 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (mo) { angle_t fa = player->mo->angle>>ANGLETOFINESHIFT; - INT32 HEIGHT = (20 + (dir*10))*mapobjectscale + player->mo->momz; + fixed_t HEIGHT = (20 + (dir*10))*mapobjectscale + player->mo->momz; - mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); - mo->momy = player->mo->momy + FixedMul(FINESINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); + mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED); + mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED); mo->momz = P_MobjFlip(player->mo) * HEIGHT; if (player->mo->eflags & MFE_VERTICALFLIP) @@ -3082,12 +3083,68 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (player->mo->eflags & MFE_VERTICALFLIP) mo->eflags |= MFE_VERTICALFLIP; + + if (mapthing == MT_SSMINE) + mo->extravalue1 = 14; // Pads the start-up length from 21 frames to a full second } } return mo; } +void K_PuntMine(mobj_t *thismine, mobj_t *punter) +{ + angle_t fa = R_PointToAngle2(0, 0, punter->momx, punter->momy) >> ANGLETOFINESHIFT; + fixed_t z = 30*mapobjectscale + punter->momz; + fixed_t spd; + mobj_t *mine; + + if (!thismine || P_MobjWasRemoved(thismine)) + return; + + if (thismine->type == MT_SSMINE_SHIELD) // Create a new mine + { + mine = P_SpawnMobj(thismine->x, thismine->y, thismine->z, MT_SSMINE); + P_SetTarget(&mine->target, thismine->target); + mine->angle = thismine->angle; + mine->flags2 = thismine->flags2; + mine->floorz = thismine->floorz; + mine->ceilingz = thismine->ceilingz; + P_RemoveMobj(thismine); + } + else + mine = thismine; + + if (!mine || P_MobjWasRemoved(mine)) + return; + + switch (gamespeed) + { + case 0: + spd = 68*mapobjectscale; // Avg Speed is 34 + break; + case 2: + spd = 96*mapobjectscale; // Avg Speed is 48 + break; + default: + spd = 82*mapobjectscale; // Avg Speed is 41 + break; + } + + mine->flags |= MF_NOCLIPTHING; + + P_SetMobjState(mine, S_SSMINE_AIR1); + mine->threshold = 10; + mine->extravalue1 = 0; + mine->reactiontime = mine->info->reactiontime; + + mine->momx = punter->momx + FixedMul(FINECOSINE(fa), spd); + mine->momy = punter->momy + FixedMul(FINESINE(fa), spd); + mine->momz = P_MobjFlip(mine) * z; + + mine->flags &= ~MF_NOCLIPTHING; +} + #define THUNDERRADIUS 320 static void K_DoThunderShield(player_t *player) diff --git a/src/k_kart.h b/src/k_kart.h index dc37956af..a09093f27 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -41,6 +41,7 @@ void K_SpawnBoostTrail(player_t *player); void K_SpawnSparkleTrail(mobj_t *mo); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_DriftDustHandling(mobj_t *spawner); +void K_PuntMine(mobj_t *mine, mobj_t *punter); void K_DoSneaker(player_t *player, INT32 type); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); diff --git a/src/p_map.c b/src/p_map.c index 41e5a455d..ed71a5466 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -980,7 +980,12 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_PLAYER) { - P_KillMobj(tmthing, thing, thing); + // Bomb punting + if ((tmthing->state >= &states[S_SSMINE1] && tmthing->state <= &states[S_SSMINE4]) + || (tmthing->state >= &states[S_SSMINE_DEPLOY8] && tmthing->state <= &states[S_SSMINE_DEPLOY13])) + P_KillMobj(tmthing, thing, thing); + else + K_PuntMine(tmthing, thing); } else if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD) @@ -1079,7 +1084,12 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->health <= 0 || thing->health <= 0) return true; - P_KillMobj(thing, tmthing, tmthing); + // Bomb punting + if ((thing->state >= &states[S_SSMINE1] && thing->state <= &states[S_SSMINE4]) + || (thing->state >= &states[S_SSMINE_DEPLOY8] && thing->state <= &states[S_SSMINE_DEPLOY13])) + P_KillMobj(thing, tmthing, tmthing); + else + K_PuntMine(thing, tmthing); } else if (thing->type == MT_MINEEXPLOSION && tmthing->player) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 746fc1afd..8a290fdfa 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8190,28 +8190,39 @@ void P_MobjThinker(mobj_t *mobj) mobj->color = mobj->target->player->skincolor; else mobj->color = SKINCOLOR_KETCHUP; + if (mobj->momx || mobj->momy) P_SpawnGhostMobj(mobj); + if (P_IsObjectOnGround(mobj)) { - if (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]) - P_SetMobjState(mobj, S_SSMINE_DEPLOY1); - if (mobj->reactiontime >= mobj->info->reactiontime) + if (mobj->extravalue1 > 0) + mobj->extravalue1--; + else { - mobj->momx = mobj->momy = 0; - S_StartSound(mobj, mobj->info->activesound); - mobj->reactiontime--; + if (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]) + P_SetMobjState(mobj, S_SSMINE_DEPLOY1); + + if (mobj->reactiontime >= mobj->info->reactiontime) + { + mobj->momx = mobj->momy = 0; + S_StartSound(mobj, mobj->info->activesound); + mobj->reactiontime--; + } } } + if (mobj->reactiontime && mobj->reactiontime < mobj->info->reactiontime) { mobj->reactiontime--; if (!mobj->reactiontime) P_KillMobj(mobj, NULL, NULL); } + if ((mobj->state >= &states[S_SSMINE1] && mobj->state <= &states[S_SSMINE4]) || (mobj->state >= &states[S_SSMINE_DEPLOY8] && mobj->state <= &states[S_SSMINE_DEPLOY13])) A_GrenadeRing(mobj); + if (mobj->threshold > 0) mobj->threshold--; break; From 4397db9b65b06c58a73328ec5e80029730f48421 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 20:19:01 -0500 Subject: [PATCH 04/81] Reduce explosion radius, lives forever, longer startup --- src/info.c | 6 +++--- src/k_kart.c | 2 +- src/p_mobj.c | 20 +++----------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/info.c b/src/info.c index 5701f1c9e..270e21fde 100644 --- a/src/info.c +++ b/src/info.c @@ -15574,10 +15574,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound - 6*TICRATE, // reactiontime + 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 192*FRACUNIT, // painchance + 128*FRACUNIT, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -15604,7 +15604,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 192*FRACUNIT, // painchance + 128*FRACUNIT, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate diff --git a/src/k_kart.c b/src/k_kart.c index 855e09034..b94341bb0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3085,7 +3085,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map mo->eflags |= MFE_VERTICALFLIP; if (mapthing == MT_SSMINE) - mo->extravalue1 = 14; // Pads the start-up length from 21 frames to a full second + mo->extravalue1 = 49; // Pads the start-up length from 21 frames to a full 2 seconds } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 8a290fdfa..6898053d4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8194,31 +8194,17 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->momx || mobj->momy) P_SpawnGhostMobj(mobj); - if (P_IsObjectOnGround(mobj)) + if (P_IsObjectOnGround(mobj) && (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2])) { if (mobj->extravalue1 > 0) mobj->extravalue1--; else { - if (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]) - P_SetMobjState(mobj, S_SSMINE_DEPLOY1); - - if (mobj->reactiontime >= mobj->info->reactiontime) - { - mobj->momx = mobj->momy = 0; - S_StartSound(mobj, mobj->info->activesound); - mobj->reactiontime--; - } + mobj->momx = mobj->momy = 0; + S_StartSound(mobj, mobj->info->activesound); } } - if (mobj->reactiontime && mobj->reactiontime < mobj->info->reactiontime) - { - mobj->reactiontime--; - if (!mobj->reactiontime) - P_KillMobj(mobj, NULL, NULL); - } - if ((mobj->state >= &states[S_SSMINE1] && mobj->state <= &states[S_SSMINE4]) || (mobj->state >= &states[S_SSMINE_DEPLOY8] && mobj->state <= &states[S_SSMINE_DEPLOY13])) A_GrenadeRing(mobj); From 5ce17bc17b6d9e8d5021d5c83640548f7cda76b5 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 20:29:53 -0500 Subject: [PATCH 05/81] Missed a line --- src/p_mobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6898053d4..a84fc1dda 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8202,6 +8202,7 @@ void P_MobjThinker(mobj_t *mobj) { mobj->momx = mobj->momy = 0; S_StartSound(mobj, mobj->info->activesound); + P_SetMobjState(mobj, S_SSMINE_DEPLOY1); } } From 4f9109501e6347919eeea1bf0fb2d2c723aaf685 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 19 Feb 2019 23:15:31 -0500 Subject: [PATCH 06/81] Hyu b gone --- src/dehacked.c | 3 +++ src/doomstat.h | 1 + src/g_game.c | 1 + src/k_kart.c | 11 ++++++----- src/p_saveg.c | 2 ++ src/p_setup.c | 1 + src/p_tick.c | 2 ++ 7 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 11aed24d0..d0c5b8dcf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9852,6 +9852,9 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"indirectitemcooldown")) { lua_pushinteger(L, indirectitemcooldown); return 1; + } else if (fastcmp(word,"hyubgone")) { + lua_pushinteger(L, hyubgone); + return 1; } else if (fastcmp(word,"thwompsactive")) { lua_pushboolean(L, thwompsactive); return 1; diff --git a/src/doomstat.h b/src/doomstat.h index 9ae2726d7..0f057273c 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -468,6 +468,7 @@ extern boolean comeback; extern SINT8 battlewanted[4]; extern tic_t wantedcalcdelay; extern tic_t indirectitemcooldown; +extern tic_t hyubgone; extern tic_t mapreset; extern UINT8 nospectategrief; extern boolean thwompsactive; diff --git a/src/g_game.c b/src/g_game.c index f0d221ff6..9edb1d847 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -267,6 +267,7 @@ SINT8 pickedvote; // What vote the host rolls SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points tic_t wantedcalcdelay; // Time before it recalculates WANTED tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any other item that works indirectly is awarded +tic_t hyubgone; // Cooldown before hyudoro is allowed to be rerolled tic_t mapreset; // Map reset delay when enough players have joined an empty game UINT8 nospectategrief; // How many players need to be in-game to eliminate last; for preventing spectate griefing boolean thwompsactive; // Thwomps activate on lap 2 diff --git a/src/k_kart.c b/src/k_kart.c index b94341bb0..4da1f6e02 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -556,6 +556,11 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = */ static void K_KartGetItemResult(player_t *player, SINT8 getitem) { + if (getitem == KITEM_SPB || getitem == KITEM_SHRINK) // Indirect items + indirectitemcooldown = 20*TICRATE; + if (getitem == KITEM_HYUDORO) // Hyudoro cooldown + hyubgone = 5*TICRATE; + switch (getitem) { // Special roulettes first, then the generic ones are handled by default @@ -583,10 +588,6 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) player->kartstuff[k_itemtype] = KITEM_JAWZ; player->kartstuff[k_itemamount] = 2; break; - case KITEM_SPB: - case KITEM_SHRINK: // Indirect items - indirectitemcooldown = 20*TICRATE; - /* FALLTHRU */ default: if (getitem <= 0 || getitem >= NUMKARTRESULTS) // Sad (Fallback) { @@ -742,7 +743,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) POWERITEMODDS(newodds); break; case KITEM_HYUDORO: - if (COOLDOWNONSTART) + if ((hyubgone > 0) || COOLDOWNONSTART) newodds = 0; break; default: diff --git a/src/p_saveg.c b/src/p_saveg.c index 975a4a5d2..f00e3f9b0 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3313,6 +3313,7 @@ static void P_NetArchiveMisc(void) WRITEUINT32(save_p, wantedcalcdelay); WRITEUINT32(save_p, indirectitemcooldown); + WRITEUINT32(save_p, hyubgone); WRITEUINT32(save_p, mapreset); WRITEUINT8(save_p, nospectategrief); WRITEUINT8(save_p, thwompsactive); @@ -3421,6 +3422,7 @@ static inline boolean P_NetUnArchiveMisc(void) wantedcalcdelay = READUINT32(save_p); indirectitemcooldown = READUINT32(save_p); + hyubgone = READUINT32(save_p); mapreset = READUINT32(save_p); nospectategrief = READUINT8(save_p); thwompsactive = (boolean)READUINT8(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index 58e13c2e0..fab433fef 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3244,6 +3244,7 @@ boolean P_SetupLevel(boolean skipprecip) wantedcalcdelay = wantedfrequency*2; indirectitemcooldown = 0; + hyubgone = 0; mapreset = 0; nospectategrief = 0; thwompsactive = false; diff --git a/src/p_tick.c b/src/p_tick.c index b46b248bb..85eaea9ba 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -680,6 +680,8 @@ void P_Ticker(boolean run) if (indirectitemcooldown) indirectitemcooldown--; + if (hyubgone) + hyubgone--; if (G_BattleGametype()) { From f9961a87ffb307f84f231a2ce25e18a63ef701d7 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 20 Feb 2019 18:55:53 -0600 Subject: [PATCH 07/81] Bump MAXSKINS to 128 Can't believe people actually need this now. --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index ab863c6f6..d538618ec 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -244,7 +244,7 @@ extern FILE *logstream; // NOTE: it needs more than this to increase the number of players... #define MAXPLAYERS 16 -#define MAXSKINS 64 +#define MAXSKINS 128 #define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 From de6c99c9fb9404014f8352d79c64522b0851d42e Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Thu, 21 Feb 2019 17:04:58 -0500 Subject: [PATCH 08/81] Grow cancel Needs item table changes to make it less OP --- src/d_player.h | 1 + src/dehacked.c | 3 ++- src/k_kart.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index b430f20a4..31f6d8432 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -354,6 +354,7 @@ typedef enum k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy k_spectatewait, // How long have you been waiting as a spectator + k_growcancel, // Hold the item button down to cancel Grow NUMKARTSTUFF } kartstufftype_t; diff --git a/src/dehacked.c b/src/dehacked.c index d0c5b8dcf..49b77bd2b 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8335,7 +8335,8 @@ static const char *const KARTSTUFF_LIST[] = { "ITEMBLINKMODE", "GETSPARKS", "JAWZTARGETDELAY", - "SPECTATEWAIT" + "SPECTATEWAIT", + "GROWCANCEL" }; static const char *const HUDITEMS_LIST[] = { diff --git a/src/k_kart.c b/src/k_kart.c index 4da1f6e02..cad54335d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1991,6 +1991,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto static void K_RemoveGrowShrink(player_t *player) { player->kartstuff[k_growshrinktimer] = 0; + player->kartstuff[k_growcancel] = 0; if (player->kartstuff[k_invincibilitytimer] == 0) player->mo->color = player->skincolor; player->mo->scalespeed = mapobjectscale/TICRATE; @@ -5093,6 +5094,18 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->kartstuff[k_rocketsneakertimer] < 1) player->kartstuff[k_rocketsneakertimer] = 1; } + // Grow Canceling + else if (player->kartstuff[k_growshrinktimer] > 0) + { + if (cmd->buttons & BT_ATTACK) + { + player->kartstuff[k_growcancel]++; + if (player->kartstuff[k_growcancel] > 26) + K_RemoveGrowShrink(player); + } + else + player->kartstuff[k_growcancel] = 0; + } else if (player->kartstuff[k_itemamount] <= 0) { player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0; @@ -5449,6 +5462,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->kartstuff[k_itemtype] != KITEM_THUNDERSHIELD) player->kartstuff[k_curshield] = 0; + if (player->kartstuff[k_growshrinktimer] <= 0) + player->kartstuff[k_growcancel] = 0; + if (player->kartstuff[k_itemtype] == KITEM_SPB || player->kartstuff[k_itemtype] == KITEM_SHRINK || player->kartstuff[k_growshrinktimer] < 0) @@ -6510,6 +6526,8 @@ static void K_drawKartItem(void) //INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); const INT32 numberdisplaymin = ((!offset && stplyr->kartstuff[k_itemtype] == KITEM_ORBINAUT) ? 5 : 2); INT32 itembar = 0; + INT32 maxl = 0; // itembar's normal highest value + const INT32 barlength = (splitscreen > 1 ? 12 : 26); UINT8 localcolor = SKINCOLOR_NONE; SINT8 colormode = TC_RAINBOW; UINT8 *colmap = NULL; @@ -6618,6 +6636,8 @@ static void K_drawKartItem(void) else if (stplyr->kartstuff[k_rocketsneakertimer] > 1) { itembar = stplyr->kartstuff[k_rocketsneakertimer]; + maxl = (itemtime*3) - barlength; + if (leveltime & 1) localpatch = kp_rocketsneaker[offset]; else @@ -6625,6 +6645,12 @@ static void K_drawKartItem(void) } else if (stplyr->kartstuff[k_growshrinktimer] > 0) { + if (stplyr->kartstuff[k_growcancel]) + { + itembar = stplyr->kartstuff[k_growcancel]; + maxl = 26; + } + if (leveltime & 1) localpatch = kp_grow[offset]; else @@ -6776,8 +6802,6 @@ static void K_drawKartItem(void) // Extensible meter, currently only used for rocket sneaker... if (itembar && hudtrans) { - const INT32 barlength = (splitscreen > 1 ? 12 : 26); - const INT32 maxl = (itemtime*3) - barlength; // timer's normal highest value const INT32 fill = ((itembar*barlength)/maxl); const INT32 length = min(barlength, fill); const INT32 height = (offset ? 1 : 2); From 02862f80104fe60f07f4bb544356a236ec0cfff9 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Fri, 22 Feb 2019 18:43:10 -0500 Subject: [PATCH 09/81] Banana snipe sfx --- src/p_map.c | 8 ++++++++ src/sounds.c | 1 + src/sounds.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index ed71a5466..9cca972a0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -912,6 +912,10 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_PLAYER) { + // Banana snipe! + if (tmthing->type == MT_BANANA && tmthing->health > 1) + S_StartSound(thing, sfx_bsnipe); + // Player Damage K_SpinPlayer(thing->player, tmthing->target, 0, tmthing, (tmthing->type == MT_BANANA || tmthing->type == MT_BANANA_SHIELD)); @@ -1061,6 +1065,10 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->health <= 0 || thing->health <= 0) return true; + // Banana snipe! + if (thing->type == MT_BANANA && thing->health > 1) + S_StartSound(tmthing, sfx_bsnipe); + // Player Damage K_SpinPlayer(tmthing->player, thing->target, 0, tmthing, (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD)); diff --git a/src/sounds.c b/src/sounds.c index a3bc8bf41..61fddb76f 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -815,6 +815,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"chain", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Mementos Reaper {"mkuma", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Trigger Happy Havoc Monokuma {"toada", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Arid Sands Toad scream + {"bsnipe", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Banana sniping {"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // :shitsfree: {"dbgsal", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Debug notification diff --git a/src/sounds.h b/src/sounds.h index 4c341d49d..bb46ea9d8 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -890,6 +890,7 @@ typedef enum sfx_chain, sfx_mkuma, sfx_toada, + sfx_bsnipe, sfx_itfree, sfx_dbgsal, From d638d47fad56b9a1cca17ed5a14acd5259abfdc0 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sat, 2 Mar 2019 15:39:52 -0500 Subject: [PATCH 10/81] 16 more colors - Renamed Crimson to Maroon. - Renamed Scarlet back to Crimson. - Renamed Nova to Scarlet. - Added Brick, Flame, Sunset, Popcorn, Camouflage, Caribbean, Plague, Platinum, Rust, Nova, Ultraviolet, Moonslam, Bubblegum, Mauve, Royal, and Fairy - Updated Maroon, Robo-Hood, and Ketchup - Shifted positioning of Aqua Super --- src/dehacked.c | 32 ++++++++++++----- src/doomdef.h | 37 +++++++++++++------ src/k_kart.c | 97 +++++++++++++++++++++++++++++++++++++------------- 3 files changed, 123 insertions(+), 43 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 7795f1f51..0088f6641 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8147,15 +8147,18 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SALMON", // SKINCOLOR_SALMON "PINK", // SKINCOLOR_PINK "ROSE", // SKINCOLOR_ROSE + "BRICK", // SKINCOLOR_BRICK "RUBY", // SKINCOLOR_RUBY "RASPBERRY", // SKINCOLOR_RASPBERRY "CHERRY", // SKINCOLOR_CHERRY "RED", // SKINCOLOR_RED - "SCARLET", // SKINCOLOR_SCARLET "CRIMSON", // SKINCOLOR_CRIMSON - "NOVA", // SKINCOLOR_NOVA + "MAROON", // SKINCOLOR_MAROON + "FLAME", // SKINCOLOR_FLAME + "SCARLET", // SKINCOLOR_SCARLET "KETCHUP", // SKINCOLOR_KETCHUP "DAWN", // SKINCOLOR_DAWN + "SUNSET", // SKINCOLOR_SUNSET "CREAMSICLE", // SKINCOLOR_CREAMSICLE "ORANGE", // SKINCOLOR_ORANGE "PUMPKIN", // SKINCOLOR_PUMPKIN @@ -8164,6 +8167,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "TANGERINE", // SKINCOLOR_TANGERINE "PEACH", // SKINCOLOR_PEACH "CARAMEL", // SKINCOLOR_CARAMEL + "POPCORN", // SKINCOLOR_POPCORN "CREAM", // SKINCOLOR_CREAM "GOLD", // SKINCOLOR_GOLD "BRONZE", // SKINCOLOR_BRONZE @@ -8177,6 +8181,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "HANDHELD", // SKINCOLOR_HANDHELD "TEA", // SKINCOLOR_TEA "PISTACHIO", // SKINCOLOR_PISTACHIO + "CAMOUFLAGE", // SKINCOLOR_CAMOUFLAGE "ROBOHOOD", // SKINCOLOR_ROBOHOOD "MOSS", // SKINCOLOR_MOSS "MINT", // SKINCOLOR_MINT @@ -8186,28 +8191,39 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SWAMP", // SKINCOLOR_SWAMP "DREAM", // SKINCOLOR_DREAM "ALGAE", // SKINCOLOR_ALGAE + "CARIBBEAN", // SKINCOLOR_CARIBBEAN + "PLAGUE", // SKINCOLOR_PLAGUE "AQUA", // SKINCOLOR_AQUA "TEAL", // SKINCOLOR_TEAL "CYAN", // SKINCOLOR_CYAN "JAWZ", // SKINCOLOR_JAWZ "CERULEAN", // SKINCOLOR_CERULEAN "NAVY", // SKINCOLOR_NAVY + "PLATINUM", // SKINCOLOR_PLATINUM "SLATE", // SKINCOLOR_SLATE "STEEL", // SKINCOLOR_STEEL + "RUST", // SKINCOLOR_RUST "JET", // SKINCOLOR_JET "SAPPHIRE", // SKINCOLOR_SAPPHIRE "PERIWINKLE", // SKINCOLOR_PERIWINKLE "BLUE", // SKINCOLOR_BLUE "BLUEBERRY", // SKINCOLOR_BLUEBERRY + "NOVA", // SKINCOLOR_NOVA "PASTEL", // SKINCOLOR_PASTEL + "ULTRAVIOLET", // SKINCOLOR_ULTRAVIOLET "DUSK", // SKINCOLOR_DUSK + "MOONSLAM", // SKINCOLOR_MOONSLAM + "BUBBLEGUM", // SKINCOLOR_BUBBLEGUM "PURPLE", // SKINCOLOR_PURPLE "FUCHSIA", // SKINCOLOR_FUCHSIA "TOXIC", // SKINCOLOR_TOXIC + "MAUVE", // SKINCOLOR_MAUVE + "ROYAL", // SKINCOLOR_ROYAL "LAVENDER", // SKINCOLOR_LAVENDER "BYZANTIUM", // SKINCOLOR_BYZANTIUM "POMEGRANATE", // SKINCOLOR_POMEGRANATE "LILAC", // SKINCOLOR_LILAC + "FAIRY", // SKINCOLOR_FAIRY // Special super colors // Super Sonic Yellow @@ -8240,6 +8256,12 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "BSUPER3", // SKINCOLOR_BSUPER3, "BSUPER4", // SKINCOLOR_BSUPER4, "BSUPER5" // SKINCOLOR_BSUPER5, + // Aqua Super + "ASUPER1", // SKINCOLOR_ASUPER1, + "ASUPER2", // SKINCOLOR_ASUPER2, + "ASUPER3", // SKINCOLOR_ASUPER3, + "ASUPER4", // SKINCOLOR_ASUPER4, + "ASUPER5" // SKINCOLOR_ASUPER5, // Hyper Sonic Green "GSUPER1", // SKINCOLOR_GSUPER1, "GSUPER2", // SKINCOLOR_GSUPER2, @@ -8258,12 +8280,6 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "CSUPER3", // SKINCOLOR_CSUPER3, "CSUPER4", // SKINCOLOR_CSUPER4, "CSUPER5", // SKINCOLOR_CSUPER5, - // Aqua Super - "ASUPER1", // SKINCOLOR_ASUPER1, - "ASUPER2", // SKINCOLOR_ASUPER2, - "ASUPER3", // SKINCOLOR_ASUPER3, - "ASUPER4", // SKINCOLOR_ASUPER4, - "ASUPER5" // SKINCOLOR_ASUPER5, }; static const char *const POWERS_LIST[] = { diff --git a/src/doomdef.h b/src/doomdef.h index 7fc92f485..59c2dfc3d 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -256,6 +256,7 @@ typedef enum SKINCOLOR_GREY, SKINCOLOR_NICKEL, SKINCOLOR_BLACK, + SKINCOLOR_POPCORN, SKINCOLOR_SEPIA, SKINCOLOR_BEIGE, SKINCOLOR_BROWN, @@ -263,15 +264,18 @@ typedef enum SKINCOLOR_SALMON, SKINCOLOR_PINK, SKINCOLOR_ROSE, + SKINCOLOR_BRICK, SKINCOLOR_RUBY, SKINCOLOR_RASPBERRY, SKINCOLOR_CHERRY, SKINCOLOR_RED, - SKINCOLOR_SCARLET, SKINCOLOR_CRIMSON, - SKINCOLOR_NOVA, + SKINCOLOR_MAROON, + SKINCOLOR_FLAME, + SKINCOLOR_SCARLET, SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, + SKINCOLOR_SUNSET, SKINCOLOR_CREAMSICLE, SKINCOLOR_ORANGE, SKINCOLOR_PUMPKIN, @@ -289,6 +293,7 @@ typedef enum SKINCOLOR_OLIVE, SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, + SKINCOLOR_CAMOUFLAGE, SKINCOLOR_LIME, SKINCOLOR_HANDHELD, SKINCOLOR_TEA, @@ -301,6 +306,8 @@ typedef enum SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, SKINCOLOR_DREAM, + SKINCOLOR_PLAGUE, + SKINCOLOR_CARIBBEAN, SKINCOLOR_ALGAE, SKINCOLOR_AQUA, SKINCOLOR_TEAL, @@ -308,24 +315,34 @@ typedef enum SKINCOLOR_JAWZ, // Oni's torment SKINCOLOR_CERULEAN, SKINCOLOR_NAVY, + SKINCOLOR_PLATINUM, SKINCOLOR_SLATE, SKINCOLOR_STEEL, + SKINCOLOR_RUST, SKINCOLOR_JET, SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave - slender aphrodite has overcome me with longing for a girl SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, SKINCOLOR_BLUEBERRY, + SKINCOLOR_NOVA, SKINCOLOR_PASTEL, + SKINCOLOR_ULTRAVIOLET, SKINCOLOR_DUSK, + SKINCOLOR_MOONSLAM, + SKINCOLOR_BUBBLEGUM, SKINCOLOR_PURPLE, SKINCOLOR_FUCHSIA, SKINCOLOR_TOXIC, + SKINCOLOR_MAUVE, + SKINCOLOR_ROYAL, SKINCOLOR_LAVENDER, SKINCOLOR_BYZANTIUM, SKINCOLOR_POMEGRANATE, SKINCOLOR_LILAC, + SKINCOLOR_FAIRY, - // Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now. + // "Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now." + // (This comment is a dirty liar! This is only limited by the integer type, so 255 for UINT8.) MAXSKINCOLORS, // Super special awesome Super flashing colors! @@ -364,6 +381,13 @@ typedef enum SKINCOLOR_BSUPER4, SKINCOLOR_BSUPER5, + // Aqua Super + SKINCOLOR_ASUPER1, + SKINCOLOR_ASUPER2, + SKINCOLOR_ASUPER3, + SKINCOLOR_ASUPER4, + SKINCOLOR_ASUPER5, + // Hyper Sonic Green SKINCOLOR_GSUPER1, SKINCOLOR_GSUPER2, @@ -385,13 +409,6 @@ typedef enum SKINCOLOR_CSUPER4, SKINCOLOR_CSUPER5, - // Aqua Super - SKINCOLOR_ASUPER1, - SKINCOLOR_ASUPER2, - SKINCOLOR_ASUPER3, - SKINCOLOR_ASUPER4, - SKINCOLOR_ASUPER5, - MAXTRANSLATIONS } skincolors_t; diff --git a/src/k_kart.c b/src/k_kart.c index 8e607191d..2bdfc40fe 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -56,15 +56,18 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Salmon", // SKINCOLOR_SALMON "Pink", // SKINCOLOR_PINK "Rose", // SKINCOLOR_ROSE + "Brick", // SKINCOLOR_BRICK "Ruby", // SKINCOLOR_RUBY "Raspberry", // SKINCOLOR_RASPBERRY "Cherry", // SKINCOLOR_CHERRY "Red", // SKINCOLOR_RED - "Scarlet", // SKINCOLOR_SCARLET "Crimson", // SKINCOLOR_CRIMSON - "Nova", // SKINCOLOR_NOVA + "Maroon", // SKINCOLOR_MAROON + "Flame", // SKINCOLOR_FLAME + "Scarlet", // SKINCOLOR_SCARLET "Ketchup", // SKINCOLOR_KETCHUP "Dawn", // SKINCOLOR_DAWN + "Sunset", // SKINCOLOR_SUNSET "Creamsicle", // SKINCOLOR_CREAMSICLE "Orange", // SKINCOLOR_ORANGE "Pumpkin", // SKINCOLOR_PUMPKIN @@ -73,6 +76,7 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Tangerine", // SKINCOLOR_TANGERINE "Peach", // SKINCOLOR_PEACH "Caramel", // SKINCOLOR_CARAMEL + "Popcorn", // SKINCOLOR_POPCORN "Cream", // SKINCOLOR_CREAM "Gold", // SKINCOLOR_GOLD "Bronze", // SKINCOLOR_BRONZE @@ -86,6 +90,7 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Handheld", // SKINCOLOR_HANDHELD "Tea", // SKINCOLOR_TEA "Pistachio", // SKINCOLOR_PISTACHIO + "Camouflage", // SKINCOLOR_CAMOUFLAGE "Robo-Hood", // SKINCOLOR_ROBOHOOD "Moss", // SKINCOLOR_MOSS "Mint", // SKINCOLOR_MINT @@ -95,28 +100,39 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Swamp", // SKINCOLOR_SWAMP "Dream", // SKINCOLOR_DREAM "Algae", // SKINCOLOR_ALGAE + "Caribbean", // SKINCOLOR_CARIBBEAN + "Plague", // SKINCOLOR_PLAGUE "Aqua", // SKINCOLOR_AQUA "Teal", // SKINCOLOR_TEAL "Cyan", // SKINCOLOR_CYAN "Jawz", // SKINCOLOR_JAWZ "Cerulean", // SKINCOLOR_CERULEAN "Navy", // SKINCOLOR_NAVY + "Platinum", // SKINCOLOR_PLATINUM "Slate", // SKINCOLOR_SLATE "Steel", // SKINCOLOR_STEEL + "Rust", // SKINCOLOR_RUST "Jet", // SKINCOLOR_JET "Sapphire", // SKINCOLOR_SAPPHIRE "Periwinkle", // SKINCOLOR_PERIWINKLE "Blue", // SKINCOLOR_BLUE "Blueberry", // SKINCOLOR_BLUEBERRY + "Nova", // SKINCOLOR_NOVA "Pastel", // SKINCOLOR_PASTEL + "Ultraviolet", // SKINCOLOR_ULTRAVIOLET "Dusk", // SKINCOLOR_DUSK + "Moonslam", // SKINCOLOR_MOONSLAM + "Bubblegum", // SKINCOLOR_BUBBLEGUM "Purple", // SKINCOLOR_PURPLE "Fuchsia", // SKINCOLOR_FUCHSIA "Toxic", // SKINCOLOR_TOXIC + "Mauve", // SKINCOLOR_MAUVE + "Royal", // SKINCOLOR_ROYAL "Lavender", // SKINCOLOR_LAVENDER "Byzantium", // SKINCOLOR_BYZANTIUM "Pomegranate", // SKINCOLOR_POMEGRANATE - "Lilac" // SKINCOLOR_LILAC + "Lilac", // SKINCOLOR_LILAC + "Fairy" // SKINCOLOR_FAIRY }; // Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later @@ -135,15 +151,18 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_TEA,8, // SKINCOLOR_SALMON SKINCOLOR_PISTACHIO,8, // SKINCOLOR_PINK SKINCOLOR_MOSS,8, // SKINCOLOR_ROSE + SKINCOLOR_RUST,8, // SKINCOLOR_BRICK SKINCOLOR_SAPPHIRE,8, // SKINCOLOR_RUBY SKINCOLOR_MINT,8, // SKINCOLOR_RASPBERRY SKINCOLOR_HANDHELD,10, // SKINCOLOR_CHERRY SKINCOLOR_GREEN,6, // SKINCOLOR_RED - SKINCOLOR_PINETREE,6, // SKINCOLOR_SCARLET - SKINCOLOR_TOXIC,8, // SKINCOLOR_CRIMSON - SKINCOLOR_ALGAE,10, // SKINCOLOR_NOVA + SKINCOLOR_PINETREE,6, // SKINCOLOR_CRIMSON + SKINCOLOR_TOXIC,8, // SKINCOLOR_MAROON + SKINCOLOR_CARIBBEAN,10, // SKINCOLOR_FLAME + SKINCOLOR_ALGAE,10, // SKINCOLOR_SCARLET SKINCOLOR_MUSTARD,10, // SKINCOLOR_KETCHUP SKINCOLOR_DUSK,8, // SKINCOLOR_DAWN + SKINCOLOR_MOONSLAM,8, // SKINCOLOR_SUNSET SKINCOLOR_PERIWINKLE,8, // SKINCOLOR_CREAMSICLE SKINCOLOR_BLUE,8, // SKINCOLOR_ORANGE SKINCOLOR_BLUEBERRY,8, // SKINCOLOR_PUMPKIN @@ -152,6 +171,7 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL + SKINCOLOR_BUBBLEGUM,8, // SKINCOLOR_POPCORN SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE @@ -165,37 +185,48 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_CHERRY,8, // SKINCOLOR_HANDHELD SKINCOLOR_SALMON,8, // SKINCOLOR_TEA SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO + SKINCOLOR_FAIRY,10, // SKINCOLOR_CAMOUFLAGE SKINCOLOR_VOMIT,8, // SKINCOLOR_ROBOHOOD SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT SKINCOLOR_RED,8, // SKINCOLOR_GREEN - SKINCOLOR_SCARLET,8, // SKINCOLOR_PINETREE + SKINCOLOR_CRIMSON,8, // SKINCOLOR_PINETREE SKINCOLOR_PURPLE,8, // SKINCOLOR_EMERALD SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM - SKINCOLOR_NOVA,10, // SKINCOLOR_ALGAE + SKINCOLOR_SCARLET,10, // SKINCOLOR_ALGAE + SKINCOLOR_FLAME,8, // SKINCOLOR_CARIBBEAN + SKINCOLOR_NOVA,8, // SKINCOLOR_PLAGUE SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUA SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN SKINCOLOR_LILAC,10, // SKINCOLOR_JAWZ SKINCOLOR_CARAMEL,8, // SKINCOLOR_CERULEAN SKINCOLOR_ROSEWOOD,8, // SKINCOLOR_NAVY + SKINCOLOR_ROYAL,8, // SKINCOLOR_PLATINUM SKINCOLOR_GOLD,10, // SKINCOLOR_SLATE SKINCOLOR_BRONZE,10, // SKINCOLOR_STEEL + SKINCOLOR_BRICK,10, // SKINCOLOR_RUST SKINCOLOR_BURGUNDY,8, // SKINCOLOR_JET SKINCOLOR_RUBY,6, // SKINCOLOR_SAPPHIRE SKINCOLOR_CREAMSICLE,8, // SKINCOLOR_PERIWINKLE SKINCOLOR_ORANGE,8, // SKINCOLOR_BLUE SKINCOLOR_PUMPKIN,8, // SKINCOLOR_BLUEBERRY + SKINCOLOR_PLAGUE,10, // SKINCOLOR_NOVA SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL + SKINCOLOR_MAUVE,10, // SKINCOLOR_ULTRAVIOLET SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK + SKINCOLOR_SUNSET,10, // SKINCOLOR_MOONSLAM SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA - SKINCOLOR_CRIMSON,8, // SKINCOLOR_TOXIC + SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC + SKINCOLOR_ULTRAVIOLET,8, // SKINCOLOR_MAUVE + SKINCOLOR_PLATINUM,6, // SKINCOLOR_ROYAL SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE - SKINCOLOR_JAWZ,6 // SKINCOLOR_LILAC + SKINCOLOR_JAWZ,6, // SKINCOLOR_LILAC + SKINCOLOR_CAMOUFLAGE,8 // SKINCOLOR_FAIRY }; UINT8 colortranslations[MAXTRANSLATIONS][16] = { @@ -212,15 +243,18 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {120, 120, 120, 121, 121, 122, 123, 124, 126, 127, 129, 131, 133, 135, 137, 139}, // SKINCOLOR_SALMON {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 + { 64, 67, 70, 73, 146, 147, 148, 150, 118, 118, 119, 119, 156, 159, 141, 143}, // SKINCOLOR_BRICK {120, 121, 144, 145, 147, 149, 132, 133, 134, 136, 198, 198, 199, 255, 30, 31}, // SKINCOLOR_RUBY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 134, 136, 137, 139, 140}, // SKINCOLOR_RASPBERRY {120, 65, 67, 69, 71, 124, 125, 127, 132, 133, 135, 136, 138, 139, 140, 141}, // SKINCOLOR_CHERRY {122, 123, 124, 126, 129, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142}, // SKINCOLOR_RED - {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_SCARLET - {123, 124, 126, 128, 132, 135, 137, 63, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_CRIMSON - { 99, 113, 113, 84, 85, 87, 126, 128, 130, 196, 197, 198, 199, 240, 243, 246}, // SKINCOLOR_NOVA - {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP + {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_CRIMSON + {123, 124, 126, 128, 132, 135, 137, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_MAROON + {120, 97, 112, 113, 113, 85, 87, 126, 149, 150, 151, 252, 253, 254, 255, 29}, // SKINCOLOR_FLAME + { 99, 113, 113, 84, 85, 87, 126, 128, 130, 196, 197, 198, 199, 240, 243, 246}, // SKINCOLOR_SCARLET + {103, 113, 113, 84, 85, 88, 127, 130, 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 + { 98, 112, 113, 84, 85, 87, 89, 149, 150, 251, 252, 206, 238, 240, 243, 246}, // SKINCOLOR_SUNSET {120, 120, 80, 80, 81, 82, 83, 83, 84, 85, 86, 88, 89, 91, 93, 95}, // SKINCOLOR_CREAMSICLE { 80, 81, 82, 83, 84, 85, 86, 88, 89, 91, 94, 95, 154, 156, 158, 159}, // SKINCOLOR_ORANGE { 82, 83, 84, 85, 87, 89, 90, 92, 94, 152, 153, 155, 157, 159, 141, 142}, // SKINCOLOR_PUMPKIN @@ -229,6 +263,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE {120, 80, 66, 70, 72, 76, 148, 149, 150, 151, 153, 154, 156, 61, 62, 63}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL + {120, 96, 97, 98, 99, 71, 32, 11, 13, 16, 18, 21, 23, 26, 28, 31}, // SKINCOLOR_POPCORN {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_CREAM {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE @@ -242,7 +277,8 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 98, 104, 105, 105, 106, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_HANDHELD {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, 176, 178, 165, 167, 168, 169, 182, 182, 171, 171, 172, 173, 174, 175, 30}, // SKINCOLOR_ROBOHOOD + { 64, 66, 69, 32, 34, 37, 40, 182, 171, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_CAMOUFLAGE + {120, 176, 160, 165, 167, 168, 169, 182, 182, 171, 60, 61, 63, 29, 30, 31}, // SKINCOLOR_ROBOHOOD {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN @@ -251,28 +287,39 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {160, 184, 185, 186, 187, 188, 189, 190, 191, 191, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {208, 209, 210, 211, 213, 220, 216, 167, 168, 188, 188, 189, 190, 191, 30, 31}, // SKINCOLOR_ALGAE + {120, 176, 177, 160, 185, 220, 216, 217, 221, 230, 206, 206, 254, 255, 29, 31}, // SKINCOLOR_CARIBBEAN + {176, 160, 184, 185, 186, 187, 188, 230, 230, 206, 206, 207, 28, 29, 30, 31}, // SKINCOLOR_PLAGUE {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 {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 {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN {211, 212, 213, 215, 216, 218, 219, 205, 206, 206, 207, 207, 28, 29, 30, 31}, // SKINCOLOR_NAVY + {120, 0, 0, 200, 200, 201, 11, 14, 17, 218, 222, 223, 238, 240, 243, 246}, // SKINCOLOR_PLATINUM {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 + { 64, 66, 68, 70, 32, 34, 36, 203, 204, 205, 24, 25, 26, 28, 29, 31}, // SKINCOLOR_RUST {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, 120, 224, 225, 226, 202, 227, 228, 229, 230, 231, 233, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 236, 238, 242, 244, 246}, // SKINCOLOR_BLUE {226, 228, 229, 230, 232, 233, 235, 237, 239, 240, 242, 244, 246, 31, 31, 31}, // SKINCOLOR_BLUEBERRY + {120, 112, 82, 83, 84, 124, 248, 228, 228, 204, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NOVA {120, 208, 209, 210, 211, 226, 202, 249, 194, 195, 196, 197, 198, 199, 255, 30}, // SKINCOLOR_PASTEL + {120, 64, 81, 122, 192, 249, 203, 221, 221, 219, 219, 223, 223, 191, 191, 31}, // SKINCOLOR_ULTRAVIOLET {121, 145, 192, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK + {120, 224, 201, 226, 202, 249, 250, 196, 197, 198, 199, 140, 141, 142, 143, 31}, // SKINCOLOR_MOONSLAM + {120, 96, 64, 121, 67, 144, 123, 192, 193, 194, 195, 196, 197, 198, 199, 30}, // SKINCOLOR_BUBBLEGUM {121, 145, 192, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_PURPLE {120, 122, 124, 125, 126, 150, 196, 197, 198, 198, 199, 199, 240, 242, 244, 246}, // SKINCOLOR_FUCHSIA {120, 120, 176, 176, 177, 6, 8, 10, 249, 250, 196, 197, 198, 199, 143, 31}, // SKINCOLOR_TOXIC + { 96, 97, 98, 112, 113, 73, 146, 248, 249, 251, 205, 205, 206, 207, 29, 31}, // SKINCOLOR_MAUVE + { 97, 112, 113, 113, 114, 78, 53, 252, 252, 253, 253, 254, 255, 29, 30, 31}, // SKINCOLOR_ROYAL {121, 145, 192, 248, 249, 250, 251, 252, 252, 253, 253, 254, 254, 255, 30, 31}, // SKINCOLOR_LAVENDER {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC + {120, 120, 121, 121, 122, 123, 10, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_FAIRY // MAXSKINCOLORS {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1 {120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2 @@ -299,6 +346,11 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {120, 120, 120, 120, 120, 120, 224, 224, 225, 226, 227, 228, 229, 230, 231, 232}, // SKINCOLOR_BSUPER3 {120, 120, 120, 120, 224, 224, 225, 226, 226, 227, 228, 229, 229, 230, 231, 232}, // SKINCOLOR_BSUPER4 {120, 120, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 232}, // SKINCOLOR_BSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2 + {120, 120, 120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3 + {120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4 + {120, 120, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5 {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 176, 160, 163, 167, 171, 175}, // SKINCOLOR_GSUPER1 {120, 120, 120, 120, 120, 120, 120, 120, 176, 176, 160, 163, 166, 169, 172, 175}, // SKINCOLOR_GSUPER2 {120, 120, 120, 120, 120, 120, 176, 176, 160, 162, 164, 166, 168, 170, 172, 175}, // SKINCOLOR_GSUPER3 @@ -314,11 +366,6 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {120, 120, 120, 120, 120, 120, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3 {120, 120, 120, 120, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4 {120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5 - {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1 - {120, 120, 120, 120, 120, 120, 120, 120, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2 - {120, 120, 120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3 - {120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4 - {120, 120, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5 // MAXTRANSLATIONS }; @@ -4317,7 +4364,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) else { player->mo->colorized = true; - player->mo->color = SKINCOLOR_SCARLET; + player->mo->color = SKINCOLOR_CRIMSON; } } else if (player->kartstuff[k_invincibilitytimer]) // setting players to use the star colormap and spawning afterimages @@ -8698,13 +8745,13 @@ void K_drawKartHUD(void) for (c = 1; c < MAXSKINCOLORS; c++) { UINT8 *cm = R_GetTranslationColormap(TC_RAINBOW, c, 0); - V_DrawFixedPatch(x<skin], cm); + V_DrawFixedPatch(x<>1, 0, facewantprefix[stplyr->skin], cm); - x += 30; - if (x > BASEVIDWIDTH-30) + x += 16; + if (x > BASEVIDWIDTH-16) { x = 0; - y += 30; + y += 16; } } } From ca861ba0c5625799374d8b3b402b14414ce05895 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 2 Mar 2019 15:56:44 -0800 Subject: [PATCH 11/81] Use long double suffix --- src/doomdef.h | 6 +++++- src/hardware/hw_bsp.c | 2 +- src/hardware/hw_dll.h | 3 --- src/hardware/r_opengl/r_opengl.c | 2 +- src/r_plane.c | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index ab863c6f6..59b1235af 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -471,13 +471,17 @@ INT32 I_GetKey(void); #define max(x, y) (((x) > (y)) ? (x) : (y)) #endif +#ifndef M_PIl +#define M_PIl 3.1415926535897932384626433832795029L +#endif + // Floating point comparison epsilons from float.h #ifndef FLT_EPSILON #define FLT_EPSILON 1.1920928955078125e-7f #endif #ifndef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 +#define DBL_EPSILON 2.2204460492503131e-16l #endif // An assert-type mechanism. diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 483932492..9e454bcd5 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -201,7 +201,7 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1, // (do not accept hit with the extensions) num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx; frac = num / den; - if (frac < 0.0 || frac > 1.0) + if (frac < 0.0l || frac > 1.0l) return NULL; // now get the frac along the BSP line diff --git a/src/hardware/hw_dll.h b/src/hardware/hw_dll.h index 6b9f4d538..466452783 100644 --- a/src/hardware/hw_dll.h +++ b/src/hardware/hw_dll.h @@ -61,9 +61,6 @@ typedef void (*I_Error_t) (const char *error, ...) FUNCIERROR; // ========================================================================== // Constants -#ifndef M_PIl -#define M_PIl 3.1415926535897932384626433832795029L -#endif #define DEGREE (0.017453292519943295769236907684883l) // 2*PI/360 void DBG_Printf(const char *lpFmt, ...) /*FUNCPRINTF*/; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3a8be6a03..8b3787da6 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2088,7 +2088,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform) pglLoadIdentity(); if (special_splitscreen) { - used_fov = atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI; + used_fov = atan(tan(used_fov*M_PIl/360.0l)*0.8l)*360/M_PIl; GLPerspective(used_fov, 2*ASPECT_RATIO); } else diff --git a/src/r_plane.c b/src/r_plane.c index 3c1fc30e8..0ff97fcc3 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -1051,7 +1051,7 @@ void R_DrawSinglePlane(visplane_t *pl) temp = P_GetZAt(pl->slope, pl->viewx, pl->viewy); zeroheight = FIXED_TO_FLOAT(temp); -#define ANG2RAD(angle) ((float)((angle)*M_PI)/ANGLE_180) +#define ANG2RAD(angle) ((float)((angle)*M_PIl)/ANGLE_180) // p is the texture origin in view space // Don't add in the offsets at this stage, because doing so can result in From 99d2af5669c3842d87026f5556388e99dd799e6b Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 4 Mar 2019 22:13:22 -0800 Subject: [PATCH 12/81] Check that lumps are okay --- src/p_saveg.c | 149 +++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 73 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 975a4a5d2..884c768f7 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -677,84 +677,87 @@ static void P_NetArchiveWorld(void) mld = W_CacheLumpNum(lastloadedmaplumpnum+ML_LINEDEFS, PU_CACHE); msd = W_CacheLumpNum(lastloadedmaplumpnum+ML_SIDEDEFS, PU_CACHE); - // do lines - for (i = 0; i < numlines; i++, mld++, li++) + if (mld && msd) { - diff = diff2 = 0; - - if (li->special != SHORT(mld->special)) - diff |= LD_SPECIAL; - - if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved - diff |= LD_CLLCOUNT; - - if (li->sidenum[0] != 0xffff) + // do lines + for (i = 0; i < numlines; i++, mld++, li++) { - si = &sides[li->sidenum[0]]; - if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<sidenum[0]].toptexture) != -1 - && si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture)) - diff |= LD_S1TOPTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1 - && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture)) - diff |= LD_S1BOTTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1 - && si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture)) - diff |= LD_S1MIDTEX; - } - if (li->sidenum[1] != 0xffff) - { - si = &sides[li->sidenum[1]]; - if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<sidenum[1]].toptexture) != -1 - && si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture)) - diff2 |= LD_S2TOPTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1 - && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture)) - diff2 |= LD_S2BOTTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1 - && si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture)) - diff2 |= LD_S2MIDTEX; - if (diff2) - diff |= LD_DIFF2; - } + diff = diff2 = 0; - if (diff) - { - statline++; - WRITEINT16(put, i); - WRITEUINT8(put, diff); - if (diff & LD_DIFF2) - WRITEUINT8(put, diff2); - if (diff & LD_FLAG) - WRITEINT16(put, li->flags); - if (diff & LD_SPECIAL) - WRITEINT16(put, li->special); - if (diff & LD_CLLCOUNT) - WRITEINT16(put, li->callcount); + if (li->special != SHORT(mld->special)) + diff |= LD_SPECIAL; - si = &sides[li->sidenum[0]]; - if (diff & LD_S1TEXOFF) - WRITEFIXED(put, si->textureoffset); - if (diff & LD_S1TOPTEX) - WRITEINT32(put, si->toptexture); - if (diff & LD_S1BOTTEX) - WRITEINT32(put, si->bottomtexture); - if (diff & LD_S1MIDTEX) - WRITEINT32(put, si->midtexture); + if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved + diff |= LD_CLLCOUNT; - si = &sides[li->sidenum[1]]; - if (diff2 & LD_S2TEXOFF) - WRITEFIXED(put, si->textureoffset); - if (diff2 & LD_S2TOPTEX) - WRITEINT32(put, si->toptexture); - if (diff2 & LD_S2BOTTEX) - WRITEINT32(put, si->bottomtexture); - if (diff2 & LD_S2MIDTEX) - WRITEINT32(put, si->midtexture); + if (li->sidenum[0] != 0xffff) + { + si = &sides[li->sidenum[0]]; + if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<sidenum[0]].toptexture) != -1 + && si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture)) + diff |= LD_S1TOPTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1 + && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture)) + diff |= LD_S1BOTTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1 + && si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture)) + diff |= LD_S1MIDTEX; + } + if (li->sidenum[1] != 0xffff) + { + si = &sides[li->sidenum[1]]; + if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<sidenum[1]].toptexture) != -1 + && si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture)) + diff2 |= LD_S2TOPTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1 + && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture)) + diff2 |= LD_S2BOTTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1 + && si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture)) + diff2 |= LD_S2MIDTEX; + if (diff2) + diff |= LD_DIFF2; + } + + if (diff) + { + statline++; + WRITEINT16(put, i); + WRITEUINT8(put, diff); + if (diff & LD_DIFF2) + WRITEUINT8(put, diff2); + if (diff & LD_FLAG) + WRITEINT16(put, li->flags); + if (diff & LD_SPECIAL) + WRITEINT16(put, li->special); + if (diff & LD_CLLCOUNT) + WRITEINT16(put, li->callcount); + + si = &sides[li->sidenum[0]]; + if (diff & LD_S1TEXOFF) + WRITEFIXED(put, si->textureoffset); + if (diff & LD_S1TOPTEX) + WRITEINT32(put, si->toptexture); + if (diff & LD_S1BOTTEX) + WRITEINT32(put, si->bottomtexture); + if (diff & LD_S1MIDTEX) + WRITEINT32(put, si->midtexture); + + si = &sides[li->sidenum[1]]; + if (diff2 & LD_S2TEXOFF) + WRITEFIXED(put, si->textureoffset); + if (diff2 & LD_S2TOPTEX) + WRITEINT32(put, si->toptexture); + if (diff2 & LD_S2BOTTEX) + WRITEINT32(put, si->bottomtexture); + if (diff2 & LD_S2MIDTEX) + WRITEINT32(put, si->midtexture); + } } } WRITEUINT16(put, 0xffff); From 19812c8a2f2a86f9efebb38578c65ba8a7b97dd0 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 17:50:43 -0500 Subject: [PATCH 13/81] Misc changes - Start cooldown deactivates exactly 30 sec, instead of after 30 seconds. Barely affects gameplay but it looks slightly less of a magic number looking at the code. - Prevent multiple Thunder Shields being out via normal means. - Slightly loosened up the invincibility item limits -- gives more invincibility items sooner for odd player counts but doesn't affect the numbers for the game's balancing points (4P, 8P) - Update comments --- src/k_kart.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 10e12da8b..b7bf86532 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -681,6 +681,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) INT32 newodds; INT32 i; UINT8 pingame = 0, pexiting = 0, pinvin = 0; + boolean thunderisout = false; SINT8 first = -1, second = -1; INT32 secondist = 0; boolean itemenabled[NUMKARTRESULTS-1] = { @@ -725,10 +726,13 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) { if (!playeringame[i] || players[i].spectator) continue; + if (!G_BattleGametype() || players[i].kartstuff[k_bumper]) pingame++; + if (players[i].exiting) pexiting++; + if (players[i].mo) { if (players[i].kartstuff[k_itemtype] == KITEM_INVINCIBILITY @@ -736,6 +740,10 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) || players[i].kartstuff[k_invincibilitytimer] || players[i].kartstuff[k_growshrinktimer] > 0) pinvin++; + + if (players[i].kartstuff[k_itemtype] == KITEM_THUNDERSHIELD) + thunderisout = true; + if (!G_BattleGametype()) { if (players[i].kartstuff[k_position] == 1 && first == -1) @@ -759,9 +767,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) // POWERITEMODDS handles all of the "frantic item" related functionality, for all of our powerful items. // First, it multiplies it by 2 if franticitems is true; easy-peasy. // Next, it multiplies it again if it's in SPB mode and 2nd needs to apply pressure to 1st. - // Then, it multiplies it further if there's less than 5 players in game. - // This is done to make low player count races more fair & interesting. (2P normal would be about halfway between 8P normal and 8P frantic) - // Lastly, it *divides* it by your mashed value, which was determined in K_KartItemRoulette, to punish those who are impatient. + // Then, it multiplies it further if the player count isn't equal to 8. + // This is done to make low player count races more interesting and high player count rates more fair. (2P normal would be about halfway between 8P normal and 8P frantic) + // Lastly, it *divides* it by your mashed value, which was determined in K_KartItemRoulette, for lesser items needed in a pinch. #define POWERITEMODDS(odds) \ if (franticitems) \ odds <<= 1; \ @@ -769,13 +777,13 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) if (mashed > 0) \ odds = FixedDiv(odds<> FRACBITS \ -#define COOLDOWNONSTART (leveltime < (31*TICRATE)+starttime) +#define COOLDOWNONSTART (leveltime < (30*TICRATE)+starttime) switch (item) { case KITEM_INVINCIBILITY: case KITEM_GROW: - if (pinvin >= max(1, (pingame+2) / 4) || COOLDOWNONSTART) + if (pinvin >= max(1, (pingame+3) / 4) || COOLDOWNONSTART) newodds = 0; else POWERITEMODDS(newodds); @@ -783,7 +791,6 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) case KITEM_ROCKETSNEAKER: case KITEM_JAWZ: case KITEM_BALLHOG: - case KITEM_THUNDERSHIELD: case KRITEM_TRIPLESNEAKER: case KRITEM_TRIPLEBANANA: case KRITEM_TENFOLDBANANA: @@ -811,6 +818,11 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) else POWERITEMODDS(newodds); break; + case KITEM_THUNDERSHIELD: + if (thunderisout) + newodds = 0; + else + POWERITEMODDS(newodds); case KITEM_HYUDORO: if ((hyubgone > 0) || COOLDOWNONSTART) newodds = 0; From 32a509beb160f52d3d66503f867987bc68e961f1 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 19:45:20 -0500 Subject: [PATCH 14/81] SPB updates - SPB Rush odds are not affected by player count. - Thunder Shield cannot be rolled with SPB out. - Reticule is displayed on minimap while SPB is out. --- src/k_kart.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b7bf86532..4c59f1e06 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -675,7 +675,7 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) \return void */ -static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) +static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean spbrush) { const INT32 distvar = (64*14); INT32 newodds; @@ -768,12 +768,17 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) // First, it multiplies it by 2 if franticitems is true; easy-peasy. // Next, it multiplies it again if it's in SPB mode and 2nd needs to apply pressure to 1st. // Then, it multiplies it further if the player count isn't equal to 8. - // This is done to make low player count races more interesting and high player count rates more fair. (2P normal would be about halfway between 8P normal and 8P frantic) + // This is done to make low player count races more interesting and high player count rates more fair. + // (2P normal would be about halfway between 8P normal and 8P frantic.) + // (This scaling is not done for SPB Rush, so that catchup strength is not weakened.) // Lastly, it *divides* it by your mashed value, which was determined in K_KartItemRoulette, for lesser items needed in a pinch. + +#define PLAYERSCALING (8 - (spbrush ? 2 : pingame)) + #define POWERITEMODDS(odds) \ if (franticitems) \ odds <<= 1; \ - odds = FixedMul(odds<> FRACBITS; \ + odds = FixedMul(odds<> FRACBITS; \ if (mashed > 0) \ odds = FixedDiv(odds<> FRACBITS \ @@ -860,7 +865,7 @@ static INT32 K_FindUseodds(player_t *player, fixed_t mashed, INT32 pingame, INT3 for (j = 1; j < NUMKARTRESULTS; j++) { - if (K_KartGetItemOdds(i, j, mashed) > 0) + if (K_KartGetItemOdds(i, j, mashed, spbrush) > 0) { available = true; break; @@ -966,6 +971,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) INT32 bestbumper = 0; fixed_t mashed = 0; boolean dontforcespb = false; + boolean spbrush = false; // This makes the roulette cycle through items - if this is 0, you shouldn't be here. if (player->kartstuff[k_itemroulette]) @@ -1058,15 +1064,18 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) return; } + if (G_RaceGametype()) + spbrush = (spbplace != -1 && player->kartstuff[k_position] == spbplace+1); + // Initializes existing spawnchance values for (i = 0; i < NUMKARTRESULTS; i++) spawnchance[i] = 0; // Split into another function for a debug function below - useodds = K_FindUseodds(player, mashed, pingame, bestbumper, (spbplace != -1 && player->kartstuff[k_position] == spbplace+1), dontforcespb); + useodds = K_FindUseodds(player, mashed, pingame, bestbumper, spbrush, dontforcespb); for (i = 1; i < NUMKARTRESULTS; i++) - spawnchance[i] = (totalspawnchance += K_KartGetItemOdds(useodds, i, mashed)); + spawnchance[i] = (totalspawnchance += K_KartGetItemOdds(useodds, i, mashed, spbrush)); // Award the player whatever power is rolled if (totalspawnchance > 0) @@ -7859,8 +7868,12 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat else colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE); V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap); - if (mo->player && K_IsPlayerWanted(mo->player)) + if (mo->player + && ((G_RaceGametype() && mo->player->kartstuff[k_position] == spbplace) + || (G_BattleGametype() && K_IsPlayerWanted(mo->player)))) + { V_DrawFixedPatch(amxpos - (4<kartstuff[k_position] == spbplace+1), dontforcespb); + if (G_RaceGametype()) + spbrush = (spbplace != -1 && stplyr->kartstuff[k_position] == spbplace+1); + + useodds = K_FindUseodds(stplyr, 0, pingame, bestbumper, spbrush, dontforcespb); for (i = 1; i < NUMKARTRESULTS; i++) { - const INT32 itemodds = K_KartGetItemOdds(useodds, i, 0); + const INT32 itemodds = K_KartGetItemOdds(useodds, i, 0, spbrush); if (itemodds <= 0) continue; From a2f0935bee4d0d3db71746af9a716d05c1095274 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 20:49:11 -0500 Subject: [PATCH 15/81] Mine updates - Increase gravity of super-forward throws - Revert explosion radius change - Nerf generic explosion stun (SPB explosion stun is identical) --- src/info.c | 4 ++-- src/k_kart.c | 19 +++++++++++++++---- src/p_mobj.c | 6 ++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/info.c b/src/info.c index 270e21fde..41711fa48 100644 --- a/src/info.c +++ b/src/info.c @@ -15577,7 +15577,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 128*FRACUNIT, // painchance + 192*FRACUNIT, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -15604,7 +15604,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 128*FRACUNIT, // painchance + 192*FRACUNIT, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate diff --git a/src/k_kart.c b/src/k_kart.c index 4c59f1e06..b1c967738 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2217,6 +2217,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b #ifdef HAVE_BLUA boolean force = false; // Used to check if Lua ShouldExplode should get us damaged reguardless of flashtics or heck knows what. UINT8 shouldForce = LUAh_ShouldExplode(player, inflictor, source); + if (P_MobjWasRemoved(player->mo)) return; // mobj was removed (in theory that shouldn't happen) if (shouldForce == 1) @@ -2227,6 +2228,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b #else static const boolean force = false; #endif + if (G_BattleGametype()) { if (K_IsPlayerWanted(player)) @@ -2308,13 +2310,13 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b } player->kartstuff[k_spinouttype] = 1; - player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2); + player->kartstuff[k_spinouttimer] = (3*TICRATE/2)+2; player->powers[pw_flashing] = K_GetKartFlashing(player); if (inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1) { - player->kartstuff[k_spinouttimer] = ((3*player->kartstuff[k_spinouttimer])/2)+1; + player->kartstuff[k_spinouttimer] = ((5*player->kartstuff[k_spinouttimer])/2)+1; player->mo->momz *= 2; } @@ -3048,12 +3050,19 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map { if (altthrow == 2) // Kitchen sink throwing { +#if 0 if (player->kartstuff[k_throwdir] == 1) dir = 3; else if (player->kartstuff[k_throwdir] == -1) dir = 1; else dir = 2; +#else + if (player->kartstuff[k_throwdir] == 1) + dir = 2; + else + dir = 1; +#endif } else { @@ -3129,10 +3138,12 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map angle_t fa = player->mo->angle>>ANGLETOFINESHIFT; fixed_t HEIGHT = (20 + (dir*10))*mapobjectscale + player->mo->momz; - mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED); - mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED); + mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED*dir); + mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED*dir); mo->momz = P_MobjFlip(player->mo) * HEIGHT; + mo->extravalue2 = dir; + if (mo->eflags & MFE_UNDERWATER) mo->momz = (117 * mo->momz) / 200; diff --git a/src/p_mobj.c b/src/p_mobj.c index da35f538d..f1074e0fc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1404,11 +1404,13 @@ fixed_t P_GetMobjGravity(mobj_t *mo) break; case MT_BANANA: case MT_EGGMANITEM: + case MT_SSMINE: + case MT_SINK: + gravityadd *= mo->extravalue2; + /* FALLTHRU */ case MT_ORBINAUT: case MT_JAWZ: case MT_JAWZ_DUD: - case MT_SSMINE: - case MT_SINK: gravityadd = (5*gravityadd)/2; break; case MT_SIGN: From 5dbdc903ba5e96d4dd758f847dc9893e6793a9e2 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 20:56:02 -0500 Subject: [PATCH 16/81] Make smoke opaque to reduce lag --- src/dehacked.c | 7 +++++++ src/info.c | 17 ++++++++++++----- src/k_kart.c | 2 ++ src/p_mobj.c | 2 ++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 530b6906a..231f0aa88 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7150,6 +7150,13 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_KARMAFIREWORK4", "S_KARMAFIREWORKTRAIL", + // Opaque smoke version, to prevent lag + "S_OPAQUESMOKE1", + "S_OPAQUESMOKE2", + "S_OPAQUESMOKE3", + "S_OPAQUESMOKE4", + "S_OPAQUESMOKE5", + #ifdef SEENAMES "S_NAMECHECK", #endif diff --git a/src/info.c b/src/info.c index 41711fa48..84cb4cd48 100644 --- a/src/info.c +++ b/src/info.c @@ -3140,11 +3140,11 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {A_FZBoomSmoke}, 1, 0, S_FZEROBOOM12}, // S_FZEROBOOM11 {SPR_NULL, 0, 1, {A_FZBoomSmoke}, 0, 0, S_NULL}, // S_FZEROBOOM12 - {SPR_SMOK, FF_TRANS30, 30, {NULL}, 0, 0, S_FZSLOWSMOKE2}, // S_FZSLOWSMOKE1 - {SPR_SMOK, FF_TRANS30|1, 30, {NULL}, 0, 0, S_FZSLOWSMOKE3}, // S_FZSLOWSMOKE2 - {SPR_SMOK, FF_TRANS30|2, 30, {NULL}, 0, 0, S_FZSLOWSMOKE4}, // S_FZSLOWSMOKE3 - {SPR_SMOK, FF_TRANS30|3, 30, {NULL}, 0, 0, S_FZSLOWSMOKE5}, // S_FZSLOWSMOKE4 - {SPR_SMOK, FF_TRANS30|4, 30, {NULL}, 0, 0, S_NULL}, // S_FZSLOWSMOKE5 + {SPR_SMOK, 0, 30, {NULL}, 0, 0, S_FZSLOWSMOKE2}, // S_FZSLOWSMOKE1 + {SPR_SMOK, 1, 30, {NULL}, 0, 0, S_FZSLOWSMOKE3}, // S_FZSLOWSMOKE2 + {SPR_SMOK, 2, 30, {NULL}, 0, 0, S_FZSLOWSMOKE4}, // S_FZSLOWSMOKE3 + {SPR_SMOK, 3, 30, {NULL}, 0, 0, S_FZSLOWSMOKE5}, // S_FZSLOWSMOKE4 + {SPR_SMOK, 4, 30, {NULL}, 0, 0, S_NULL}, // S_FZSLOWSMOKE5 // Various plants {SPR_SBUS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SONICBUSH @@ -3394,6 +3394,13 @@ state_t states[NUMSTATES] = {SPR_FWRK, 3|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK1}, // S_KARMAFIREWORK4 {SPR_FWRK, 4|FF_FULLBRIGHT, TICRATE, {NULL}, 0, 0, S_NULL}, // S_KARMAFIREWORKTRAIL + // Opaque smoke + {SPR_SMOK, 0, 4, {NULL}, 0, 0, S_OPAQUESMOKE2}, // S_OPAQUESMOKE1 + {SPR_SMOK, 1, 5, {NULL}, 0, 0, S_OPAQUESMOKE3}, // S_OPAQUESMOKE2 + {SPR_SMOK, 2, 6, {NULL}, 0, 0, S_OPAQUESMOKE4}, // S_OPAQUESMOKE3 + {SPR_SMOK, 3, 7, {NULL}, 0, 0, S_OPAQUESMOKE5}, // S_OPAQUESMOKE4 + {SPR_SMOK, 4, 8, {NULL}, 0, 0, S_NULL}, // S_OPAQUESMOKE5 + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif diff --git a/src/k_kart.c b/src/k_kart.c index b1c967738..dee5df73e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2515,6 +2515,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) for (i = 0; i < 32; i++) { dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE); + P_SetMobjState(dust, S_OPAQUESMOKE1); dust->angle = (ANGLE_180/16) * i; P_SetScale(dust, source->scale); dust->destscale = source->scale*10; @@ -2542,6 +2543,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) dust = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, source->y + P_RandomRange(-radius, radius)*FRACUNIT, source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE); + P_SetMobjState(dust, S_OPAQUESMOKE1); P_SetScale(dust, source->scale); dust->destscale = source->scale*10; dust->scalespeed = source->scale/12; diff --git a/src/p_mobj.c b/src/p_mobj.c index f1074e0fc..6d36dcc95 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6653,6 +6653,7 @@ void P_MobjThinker(mobj_t *mobj) fixed_t y = P_RandomRange(-35, 35)*mobj->scale; fixed_t z = P_RandomRange(0, 70)*mobj->scale; mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE); + P_SetMobjState(smoke, S_OPAQUESMOKE1); smoke->scale = mobj->scale * 2; smoke->destscale = mobj->scale * 6; smoke->momz = P_RandomRange(4, 9)*FRACUNIT; @@ -6674,6 +6675,7 @@ void P_MobjThinker(mobj_t *mobj) else { mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE); + P_SetMobjState(smoke, S_OPAQUESMOKE1); smoke->scale = mobj->scale; smoke->destscale = mobj->scale*2; } From 2f9719f80e3df01831c5d52c616692f780642f1d Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 21:25:37 -0500 Subject: [PATCH 17/81] uncommited change... :anger: --- src/info.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/info.h b/src/info.h index 157c72e1b..0e23a07c5 100644 --- a/src/info.h +++ b/src/info.h @@ -4052,6 +4052,12 @@ typedef enum state S_KARMAFIREWORK4, S_KARMAFIREWORKTRAIL, + S_OPAQUESMOKE1, + S_OPAQUESMOKE2, + S_OPAQUESMOKE3, + S_OPAQUESMOKE4, + S_OPAQUESMOKE5, + #ifdef SEENAMES S_NAMECHECK, #endif From 75a2ed75344822bd5a26d00e4d8982a071b8e25c Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 22:02:41 -0500 Subject: [PATCH 18/81] Add banana snipe sound effect to eggboxes & sinks --- src/p_inter.c | 4 ++++ src/p_map.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index dd27858fc..824d714d0 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -411,6 +411,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->kartstuff[k_roulettetype] = 2; } + // Eggbox snipe! + if (special->type == MT_EGGMANITEM && special->health > 1) + S_StartSound(toucher, sfx_bsnipe); + { mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); S_StartSound(poof, special->info->deathsound); diff --git a/src/p_map.c b/src/p_map.c index d3680c6ca..843f588cc 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -853,7 +853,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_PLAYER) { - S_StartSound(NULL, sfx_cgot); //let all players hear it. + S_StartSound(NULL, sfx_bsnipe); //let all players hear it. HU_SetCEchoFlags(0); HU_SetCEchoDuration(5); HU_DoCEcho(va("%s\\was hit by a kitchen sink.\\\\\\\\", player_names[thing->player-players])); From 354a90330f239653dde75e9bff12fd0d49c47729 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Tue, 5 Mar 2019 22:06:47 -0500 Subject: [PATCH 19/81] Put eggbox sniping behind an #if On second thought, the old method is "sneakier" --- src/p_inter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index 824d714d0..7da581a5f 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -411,9 +411,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->kartstuff[k_roulettetype] = 2; } +#if 0 // Eggbox snipe! if (special->type == MT_EGGMANITEM && special->health > 1) S_StartSound(toucher, sfx_bsnipe); +#endif { mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); From a0b06044b1610c6b9df0cbe60249be7cfc1d77db Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 5 Mar 2019 22:07:53 -0500 Subject: [PATCH 20/81] Don't skip frames in software mode --- src/sdl/i_video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2a77604d2..0568dcee4 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1355,8 +1355,9 @@ void I_FinishUpdate(void) if (rendermode == render_none) return; //Alam: No software or OpenGl surface - if (I_SkipFrame()) - return; + // Don't skip frames + //if (I_SkipFrame()) + //return; if (cv_ticrate.value) SCR_DisplayTicRate(); From b9543d18b421df7fc30926f0f8ba04321e916b49 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 5 Mar 2019 22:27:25 -0600 Subject: [PATCH 21/81] hblurgle spburgle this code sucks --- src/d_clisrv.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++-- src/d_clisrv.h | 13 +++++- src/d_netcmd.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ src/d_netcmd.h | 6 +++ 4 files changed, 225 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 8e2a42de8..e1c4f8bc0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1126,13 +1126,55 @@ typedef enum CL_DOWNLOADSAVEGAME, #endif CL_CONNECTED, - CL_ABORTED + CL_ABORTED, + CL_CHALLENGE } cl_mode_t; static void GetPackets(void); static cl_mode_t cl_mode = CL_SEARCHING; +static UINT8 cl_challengenum = 0; +static UINT8 cl_challengequestion[17]; +static char cl_challengepassword[65]; +static UINT8 cl_challengeanswer[17]; + +static void D_JoinChallengeInput(INT32 ch) +{ + size_t len; + + while (ch) + { + if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && hu_font[ch-HU_FONTSTART]) + || ch == ' ') // Allow spaces, of course + { + len = strlen(cl_challengepassword); + if (len < 64) + { + cl_challengepassword[len+1] = 0; + cl_challengepassword[len] = ch; + } + } + else if (ch == KEY_BACKSPACE) + { + len = strlen(cl_challengepassword); + + if (len > 0) + cl_challengepassword[len-1] = 0; + } + else if (ch == KEY_ENTER) + { + // Done? + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_mode = CL_ASKJOIN; + return; + } + + ch = I_GetKey(); + } + +} + // Player name send/load static void CV_SavePlayerNames(UINT8 **p) @@ -1191,11 +1233,25 @@ static inline void CL_DrawConnectionStatus(void) // 15 pal entries total. const char *cltext; - for (i = 0; i < 16; ++i) - V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15)); + if (cl_mode != CL_CHALLENGE) + for (i = 0; i < 16; ++i) + V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15)); switch (cl_mode) { + case CL_CHALLENGE: + { + char asterisks[65]; + size_t sl = strlen(cl_challengepassword); + + memset(asterisks, '*', sl); + memset(asterisks+sl, 0, 65-sl); + + V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); + + cltext = M_GetText("Please enter the server password."); + } + break; #ifdef JOININGAME case CL_DOWNLOADSAVEGAME: if (lastfilenum != -1) @@ -1292,6 +1348,8 @@ static boolean CL_SendJoin(void) netbuffer->u.clientcfg.localplayers = localplayers; netbuffer->u.clientcfg.version = VERSION; netbuffer->u.clientcfg.subversion = SUBVERSION; + netbuffer->u.clientcfg.challengenum = cl_challengenum; + memcpy(netbuffer->u.clientcfg.challengeanswer, cl_challengeanswer, 16); return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak)); } @@ -2059,6 +2117,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic break; #endif + case CL_CHALLENGE: case CL_WAITJOINRESPONSE: case CL_CONNECTED: default: @@ -2091,6 +2150,8 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic D_StartTitle(); return false; } + else if (cl_mode == CL_CHALLENGE) + D_JoinChallengeInput(key); // why are these here? this is for servers, we're a client //if (key == 's' && server) @@ -3142,6 +3203,9 @@ void D_ClientServerInit(void) gametic = 0; localgametic = 0; + memset(cl_challengequestion, 0x00, 17); + memset(cl_challengeanswer, 0x00, 17); + // do not send anything before the real begin SV_StopServer(); SV_ResetServer(); @@ -3631,6 +3695,26 @@ static void HandleConnect(SINT8 node) boolean newnode = false; #endif + if (D_IsJoinPasswordOn()) + { + // Ensure node sent the correct password challenge + boolean passed = false; + + if (netbuffer->u.clientcfg.challengenum && D_VerifyJoinPasswordChallenge(netbuffer->u.clientcfg.challengenum, netbuffer->u.clientcfg.challengeanswer)) + passed = true; + + if (!passed) + { + D_MakeJoinPasswordChallenge(&netbuffer->u.joinchallenge.challengenum, netbuffer->u.joinchallenge.question); + + netbuffer->packettype = PT_JOINCHALLENGE; + HSendPacket(node, true, 0, sizeof(joinchallenge_pak)); + //Net_CloseConnection(node); + + return; + } + } + // client authorised to join nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]); if (!nodeingame[node]) @@ -3794,6 +3878,22 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; + case PT_JOINCHALLENGE: + if (server && serverrunning) + { // But wait I thought I'm the server? + Net_CloseConnection(node); + break; + } + SERVERONLY + if (cl_mode == CL_WAITJOINRESPONSE) + { + cl_challengenum = netbuffer->u.joinchallenge.challengenum; + memcpy(cl_challengequestion, netbuffer->u.joinchallenge.question, 16); + + cl_mode = CL_CHALLENGE; + } + break; + case PT_SERVERREFUSE: // Negative response of client join request if (server && serverrunning) { // But wait I thought I'm the server? diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 6615d67dd..e4ff7cc74 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -73,6 +73,8 @@ typedef enum PT_CLIENT4MIS, PT_BASICKEEPALIVE,// Keep the network alive during wipes, as tics aren't advanced and NetUpdate isn't called + PT_JOINCHALLENGE, // You must give a password to joinnnnn + PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL // allows HSendPacket(*, true, *, *) to return false. // In addition, this packet can't occupy all the available slots. @@ -354,8 +356,16 @@ typedef struct UINT8 subversion; // Contains build version UINT8 localplayers; UINT8 mode; + UINT8 challengenum; // Non-zero if trying to join with a password attempt + UINT8 challengeanswer[16]; // Join challenge } ATTRPACK clientconfig_pak; +typedef struct +{ + UINT8 challengenum; // Number to send back in join attempt + UINT8 question[16]; // Challenge data to be manipulated and answered with +} ATTRPACK joinchallenge_pak; + #define MAXSERVERNAME 32 #define MAXFILENEEDED 915 // This packet is too large @@ -447,7 +457,8 @@ typedef struct UINT8 resynchgot; // UINT8 textcmd[MAXTEXTCMD+1]; // 66049 bytes (wut??? 64k??? More like 257 bytes...) filetx_pak filetxpak; // 139 bytes - clientconfig_pak clientcfg; // 136 bytes + clientconfig_pak clientcfg; // 153 bytes + joinchallenge_pak joinchallenge; // 17 bytes serverinfo_pak serverinfo; // 1024 bytes serverrefuse_pak serverrefuse; // 65025 bytes (somehow I feel like those values are garbage...) askinfo_pak askinfo; // 61 bytes diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a8efd3066..a8014ec42 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -169,6 +169,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum); static void Got_Removal(UINT8 **cp, INT32 playernum); static void Command_Verify_f(void); static void Command_RemoveAdmin_f(void); +static void Command_ChangeJoinPassword_f(void); static void Command_MotD_f(void); static void Got_MotD_f(UINT8 **cp, INT32 playernum); @@ -534,6 +535,7 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_PICKVOTE, Got_PickVotecmd); // Remote Administration + COM_AddCommand("joinpassword", Command_ChangeJoinPassword_f); COM_AddCommand("password", Command_Changepassword_f); RegisterNetXCmd(XD_LOGIN, Got_Login); COM_AddCommand("login", Command_Login_f); // useful in dedicated to kick off remote admin @@ -3427,6 +3429,7 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, if (len > 256-sl) len = 256-sl; + memcpy(tmpbuf, buffer, len); memmove(&tmpbuf[len], salt, sl); //strcpy(&tmpbuf[len], salt); @@ -3702,6 +3705,107 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) CONS_Printf(M_GetText("You are no longer a server administrator.\n")); } +// Join password stuff +#define NUMJOINCHALLENGES 32 +static UINT8 joinpassmd5[17]; +static boolean joinpasswordset = false; +static UINT8 joinpasschallenges[NUMJOINCHALLENGES][17]; +static boolean joinpasschallengeson[NUMJOINCHALLENGES]; + +boolean D_IsJoinPasswordOn(void) +{ + return joinpasswordset; +} + +static inline void GetChallengeAnswer(UINT8 *question, UINT8 *passwordmd5, UINT8 *answer) +{ + D_MD5PasswordPass(question, 16, (char *) passwordmd5, answer); +} + +void D_ComputeChallengeAnswer(UINT8 *question, const char *pw, UINT8 *answer) +{ + static UINT8 passwordmd5[17]; + + memset(passwordmd5, 0x00, 17); + D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &passwordmd5); + GetChallengeAnswer(question, passwordmd5, answer); +} + +void D_SetJoinPassword(const char *pw) +{ + memset(joinpassmd5, 0x00, 17); + D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &joinpassmd5); + joinpasswordset = true; +} + +boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer) +{ + boolean passed = false; + + num %= NUMJOINCHALLENGES; + + //@TODO use a constant-time memcmp.... + if (joinpasschallengeson[num] && memcmp(answer, joinpasschallenges[num], 16) == 0) + passed = true; + + // Wipe and reset the challenge so that it can't be tried against again, as a small measure against brute-force attacks. + memset(joinpasschallenges[num], 0x00, 17); + joinpasschallengeson[num] = false; + + return passed; +} + +void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question) +{ + size_t i; + + for (i = 0; i < NUMJOINCHALLENGES; i++) + { + (*num) = M_RandomKey(NUMJOINCHALLENGES); + + if (!joinpasschallengeson[(*num)]) + break; + } + + // If the above loop never breaks, then uh.... we're obliterating one random stored challenge. Sorry (: + joinpasschallengeson[(*num)] = true; + + memset(question, 0x00, 17); + for (i = 0; i < 16; i++) + question[i] = M_RandomByte(); + + // Store the answer in memory. What was the question again? + GetChallengeAnswer(question, joinpassmd5, joinpasschallenges[(*num)]); + + // This ensures that num is always non-zero and will be valid when used for the answer + if ((*num) == 0) + (*num) = NUMJOINCHALLENGES; +} + +// Remote Administration +static void Command_ChangeJoinPassword_f(void) +{ +#ifdef NOMD5 + // If we have no MD5 support then completely disable XD_LOGIN responses for security. + CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n"); +#else + if (client) // cannot change remotely + { + CONS_Printf(M_GetText("Only the server can use this.\n")); + return; + } + + if (COM_Argc() != 2) + { + CONS_Printf(M_GetText("joinpassword : set a password to join the server\n")); + return; + } + + D_SetJoinPassword(COM_Argv(1)); + CONS_Printf(M_GetText("Join password set.\n")); +#endif +} + static void Command_MotD_f(void) { size_t i, j; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index e08270132..438ba3ff1 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -248,6 +248,12 @@ void RemoveAdminPlayer(INT32 playernum); void ItemFinder_OnChange(void); void D_SetPassword(const char *pw); +boolean D_IsJoinPasswordOn(void); +void D_ComputeChallengeAnswer(UINT8 *question, const char *pw, UINT8 *answer); +void D_SetJoinPassword(const char *pw); +boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer); +void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question); + // used for the player setup menu UINT8 CanChangeSkin(INT32 playernum); From b10d0f74c994a823fd1c2ccecf485bf5211be156 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Wed, 6 Mar 2019 01:53:52 -0500 Subject: [PATCH 22/81] Fix floating lob items --- src/p_mobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6d36dcc95..7f4e747c6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1406,7 +1406,8 @@ fixed_t P_GetMobjGravity(mobj_t *mo) case MT_EGGMANITEM: case MT_SSMINE: case MT_SINK: - gravityadd *= mo->extravalue2; + if (mo->extravalue2 > 0) + gravityadd *= mo->extravalue2; /* FALLTHRU */ case MT_ORBINAUT: case MT_JAWZ: From 5d0fbc2af058a00236f71d0523d70e2077658446 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Wed, 6 Mar 2019 03:15:07 -0500 Subject: [PATCH 23/81] Reorder colors, ensure colored names are set properly --- src/dehacked.c | 18 +++--- src/doomdef.h | 12 ++-- src/hu_stuff.c | 163 ++++++++++++++++++++++++++++++++++++++----------- src/k_kart.c | 42 ++++++------- 4 files changed, 164 insertions(+), 71 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 0088f6641..421d5b44d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8140,6 +8140,8 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "GREY", // SKINCOLOR_GREY "NICKEL", // SKINCOLOR_NICKEL "BLACK", // SKINCOLOR_BLACK + "FAIRY", // SKINCOLOR_FAIRY + "POPCORN", // SKINCOLOR_POPCORN "SEPIA", // SKINCOLOR_SEPIA "BEIGE", // SKINCOLOR_BEIGE "BROWN", // SKINCOLOR_BROWN @@ -8167,9 +8169,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "TANGERINE", // SKINCOLOR_TANGERINE "PEACH", // SKINCOLOR_PEACH "CARAMEL", // SKINCOLOR_CARAMEL - "POPCORN", // SKINCOLOR_POPCORN "CREAM", // SKINCOLOR_CREAM "GOLD", // SKINCOLOR_GOLD + "ROYAL", // SKINCOLOR_ROYAL "BRONZE", // SKINCOLOR_BRONZE "COPPER", // SKINCOLOR_COPPER "YELLOW", // SKINCOLOR_YELLOW @@ -8181,18 +8183,18 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "HANDHELD", // SKINCOLOR_HANDHELD "TEA", // SKINCOLOR_TEA "PISTACHIO", // SKINCOLOR_PISTACHIO + "MOSS", // SKINCOLOR_MOSS "CAMOUFLAGE", // SKINCOLOR_CAMOUFLAGE "ROBOHOOD", // SKINCOLOR_ROBOHOOD - "MOSS", // SKINCOLOR_MOSS "MINT", // SKINCOLOR_MINT "GREEN", // SKINCOLOR_GREEN "PINETREE", // SKINCOLOR_PINETREE "EMERALD", // SKINCOLOR_EMERALD "SWAMP", // SKINCOLOR_SWAMP "DREAM", // SKINCOLOR_DREAM + "PLAGUE", // SKINCOLOR_PLAGUE "ALGAE", // SKINCOLOR_ALGAE "CARIBBEAN", // SKINCOLOR_CARIBBEAN - "PLAGUE", // SKINCOLOR_PLAGUE "AQUA", // SKINCOLOR_AQUA "TEAL", // SKINCOLOR_TEAL "CYAN", // SKINCOLOR_CYAN @@ -8210,20 +8212,18 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "BLUEBERRY", // SKINCOLOR_BLUEBERRY "NOVA", // SKINCOLOR_NOVA "PASTEL", // SKINCOLOR_PASTEL + "MOONSLAM", // SKINCOLOR_MOONSLAM "ULTRAVIOLET", // SKINCOLOR_ULTRAVIOLET "DUSK", // SKINCOLOR_DUSK - "MOONSLAM", // SKINCOLOR_MOONSLAM "BUBBLEGUM", // SKINCOLOR_BUBBLEGUM "PURPLE", // SKINCOLOR_PURPLE "FUCHSIA", // SKINCOLOR_FUCHSIA "TOXIC", // SKINCOLOR_TOXIC - "MAUVE", // SKINCOLOR_MAUVE - "ROYAL", // SKINCOLOR_ROYAL "LAVENDER", // SKINCOLOR_LAVENDER "BYZANTIUM", // SKINCOLOR_BYZANTIUM + "MAUVE", // SKINCOLOR_MAUVE "POMEGRANATE", // SKINCOLOR_POMEGRANATE "LILAC", // SKINCOLOR_LILAC - "FAIRY", // SKINCOLOR_FAIRY // Special super colors // Super Sonic Yellow @@ -8261,7 +8261,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "ASUPER2", // SKINCOLOR_ASUPER2, "ASUPER3", // SKINCOLOR_ASUPER3, "ASUPER4", // SKINCOLOR_ASUPER4, - "ASUPER5" // SKINCOLOR_ASUPER5, + "ASUPER5", // SKINCOLOR_ASUPER5, // Hyper Sonic Green "GSUPER1", // SKINCOLOR_GSUPER1, "GSUPER2", // SKINCOLOR_GSUPER2, @@ -8279,7 +8279,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "CSUPER2", // SKINCOLOR_CSUPER2, "CSUPER3", // SKINCOLOR_CSUPER3, "CSUPER4", // SKINCOLOR_CSUPER4, - "CSUPER5", // SKINCOLOR_CSUPER5, + "CSUPER5" // SKINCOLOR_CSUPER5, }; static const char *const POWERS_LIST[] = { diff --git a/src/doomdef.h b/src/doomdef.h index 59c2dfc3d..e5544c077 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -257,6 +257,7 @@ typedef enum SKINCOLOR_NICKEL, SKINCOLOR_BLACK, SKINCOLOR_POPCORN, + SKINCOLOR_FAIRY, SKINCOLOR_SEPIA, SKINCOLOR_BEIGE, SKINCOLOR_BROWN, @@ -286,6 +287,7 @@ typedef enum SKINCOLOR_CARAMEL, SKINCOLOR_CREAM, SKINCOLOR_GOLD, + SKINCOLOR_ROYAL, SKINCOLOR_BRONZE, SKINCOLOR_COPPER, SKINCOLOR_YELLOW, @@ -293,13 +295,13 @@ typedef enum SKINCOLOR_OLIVE, SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, - SKINCOLOR_CAMOUFLAGE, SKINCOLOR_LIME, SKINCOLOR_HANDHELD, SKINCOLOR_TEA, SKINCOLOR_PISTACHIO, - SKINCOLOR_ROBOHOOD, SKINCOLOR_MOSS, + SKINCOLOR_CAMOUFLAGE, + SKINCOLOR_ROBOHOOD, SKINCOLOR_MINT, SKINCOLOR_GREEN, SKINCOLOR_PINETREE, @@ -307,8 +309,8 @@ typedef enum SKINCOLOR_SWAMP, SKINCOLOR_DREAM, SKINCOLOR_PLAGUE, - SKINCOLOR_CARIBBEAN, SKINCOLOR_ALGAE, + SKINCOLOR_CARIBBEAN, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, @@ -326,20 +328,18 @@ typedef enum SKINCOLOR_BLUEBERRY, SKINCOLOR_NOVA, SKINCOLOR_PASTEL, + SKINCOLOR_MOONSLAM, SKINCOLOR_ULTRAVIOLET, SKINCOLOR_DUSK, - SKINCOLOR_MOONSLAM, SKINCOLOR_BUBBLEGUM, SKINCOLOR_PURPLE, SKINCOLOR_FUCHSIA, SKINCOLOR_TOXIC, SKINCOLOR_MAUVE, - SKINCOLOR_ROYAL, SKINCOLOR_LAVENDER, SKINCOLOR_BYZANTIUM, SKINCOLOR_POMEGRANATE, SKINCOLOR_LILAC, - SKINCOLOR_FAIRY, // "Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now." // (This comment is a dirty liar! This is only limited by the integer type, so 255 for UINT8.) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 94cca970b..458705773 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -778,44 +778,139 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } } else - { + { const UINT8 color = players[playernum].skincolor; cstart = "\x83"; - if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE) - cstart = "\x80"; // white - else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET) - cstart = "\x86"; // V_GRAYMAP - else if (color <= SKINCOLOR_LEATHER) - cstart = "\x8e"; // V_BROWNMAP - else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC) - cstart = "\x8d"; // V_PINKMAP - else if (color <= SKINCOLOR_KETCHUP) - cstart = "\x85"; // V_REDMAP - else if (color <= SKINCOLOR_TANGERINE) - cstart = "\x87"; // V_ORANGEMAP - else if (color <= SKINCOLOR_CREAM) - cstart = "\x8f"; // V_PEACHMAP - else if (color <= SKINCOLOR_COPPER) - cstart = "\x8A"; // V_GOLDMAP - else if (color <= SKINCOLOR_OLIVE) - cstart = "\x82"; // V_YELLOWMAP - else if (color <= SKINCOLOR_PISTACHIO) - cstart = "\x8b"; // V_TEAMAP - else if (color <= SKINCOLOR_ALGAE || color == SKINCOLOR_LIME || color == SKINCOLOR_HANDHELD) - cstart = "\x83"; // V_GREENMAP - else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) - cstart = "\x88"; // V_SKYMAP - else if (color <= SKINCOLOR_STEEL) - cstart = "\x8c"; // V_STEELMAP - else if (color <= SKINCOLOR_BLUEBERRY) - cstart = "\x84"; // V_BLUEMAP - else if (color == SKINCOLOR_PURPLE) - cstart = "\x81"; // V_PURPLEMAP - else //if (color <= SKINCOLOR_POMEGRANATE) - cstart = "\x89"; // V_LAVENDERMAP - } + switch (color) + { + case SKINCOLOR_WHITE: + case SKINCOLOR_SILVER: + case SKINCOLOR_SLATE: + cstart = "\x80"; // White + break; + case SKINCOLOR_GREY: + case SKINCOLOR_NICKEL: + case SKINCOLOR_BLACK: + case SKINCOLOR_JET: + cstart = "\x86"; // V_GRAYMAP + break; + case SKINCOLOR_SEPIA: + case SKINCOLOR_BEIGE: + case SKINCOLOR_BROWN: + case SKINCOLOR_LEATHER: + case SKINCOLOR_RUST: + cstart = "\x8e"; // V_BROWNMAP + break; + case SKINCOLOR_FAIRY: + case SKINCOLOR_SALMON: + case SKINCOLOR_PINK: + case SKINCOLOR_ROSE: + case SKINCOLOR_BRICK: + case SKINCOLOR_BUBBLEGUM: + case SKINCOLOR_LILAC: + cstart = "\x8d"; // V_PINKMAP + break; + case SKINCOLOR_RUBY: + case SKINCOLOR_RASPBERRY: + case SKINCOLOR_CHERRY: + case SKINCOLOR_RED: + case SKINCOLOR_CRIMSON: + case SKINCOLOR_MAROON: + case SKINCOLOR_FLAME: + case SKINCOLOR_SCARLET: + case SKINCOLOR_KETCHUP: + cstart = "\x85"; // V_REDMAP + break; + case SKINCOLOR_DAWN: + case SKINCOLOR_SUNSET: + case SKINCOLOR_CREAMSICLE: + case SKINCOLOR_ORANGE: + case SKINCOLOR_PUMPKIN: + case SKINCOLOR_ROSEWOOD: + case SKINCOLOR_BURGUNDY: + case SKINCOLOR_TANGERINE: + cstart = "\x87"; // V_ORANGEMAP + break; + case SKINCOLOR_PEACH: + case SKINCOLOR_CARAMEL: + case SKINCOLOR_CREAM: + cstart = "\x8f"; // V_PEACHMAP + break; + case SKINCOLOR_GOLD: + case SKINCOLOR_ROYAL: + case SKINCOLOR_BRONZE: + case SKINCOLOR_COPPER: + cstart = "\x8A"; // V_GOLDMAP + break; + case SKINCOLOR_POPCORN: + case SKINCOLOR_YELLOW: + case SKINCOLOR_MUSTARD: + case SKINCOLOR_OLIVE: + cstart = "\x82"; // V_YELLOWMAP + break; + case SKINCOLOR_VOMIT: + case SKINCOLOR_GARDEN: + case SKINCOLOR_TEA: + case SKINCOLOR_PISTACHIO: + cstart = "\x8b"; // V_TEAMAP + break; + case SKINCOLOR_LIME: + case SKINCOLOR_HANDHELD: + case SKINCOLOR_MOSS: + case SKINCOLOR_CAMOUFLAGE: + case SKINCOLOR_ROBOHOOD: + case SKINCOLOR_MINT: + case SKINCOLOR_GREEN: + case SKINCOLOR_PINETREE: + case SKINCOLOR_EMERALD: + case SKINCOLOR_SWAMP: + case SKINCOLOR_DREAM: + case SKINCOLOR_PLAGUE: + case SKINCOLOR_ALGAE: + cstart = "\x83"; // V_GREENMAP + break; + case SKINCOLOR_CARIBBEAN: + case SKINCOLOR_AQUA: + case SKINCOLOR_TEAL: + case SKINCOLOR_CYAN: + case SKINCOLOR_JAWZ: + case SKINCOLOR_CERULEAN: + case SKINCOLOR_NAVY: + case SKINCOLOR_SAPPHIRE: + cstart = "\x88"; // V_SKYMAP + break; + case SKINCOLOR_PLATINUM: + case SKINCOLOR_STEEL: + cstart = "\x8c"; // V_STEELMAP + break; + case SKINCOLOR_PERIWINKLE: + case SKINCOLOR_BLUE: + case SKINCOLOR_BLUEBERRY: + case SKINCOLOR_NOVA: + cstart = "\x84"; // V_BLUEMAP + break; + case SKINCOLOR_ULTRAVIOLET: + case SKINCOLOR_PURPLE: + case SKINCOLOR_FUCHSIA: + cstart = "\x81"; // V_PURPLEMAP + break; + case SKINCOLOR_PASTEL: + case SKINCOLOR_MOONSLAM: + case SKINCOLOR_DUSK: + case SKINCOLOR_TOXIC: + case SKINCOLOR_MAUVE: + case SKINCOLOR_LAVENDER: + case SKINCOLOR_BYZANTIUM: + case SKINCOLOR_POMEGRANATE: + cstart = "\x89"; // V_LAVENDERMAP + break; + default: + break; + } + } + prefix = cstart; // Give admins and remote admins their symbols. diff --git a/src/k_kart.c b/src/k_kart.c index 2bdfc40fe..d75e5e42a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -49,6 +49,8 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Grey", // SKINCOLOR_GREY "Nickel", // SKINCOLOR_NICKEL "Black", // SKINCOLOR_BLACK + "Fairy", // SKINCOLOR_FAIRY + "Popcorn", // SKINCOLOR_POPCORN "Sepia", // SKINCOLOR_SEPIA "Beige", // SKINCOLOR_BEIGE "Brown", // SKINCOLOR_BROWN @@ -76,9 +78,9 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Tangerine", // SKINCOLOR_TANGERINE "Peach", // SKINCOLOR_PEACH "Caramel", // SKINCOLOR_CARAMEL - "Popcorn", // SKINCOLOR_POPCORN "Cream", // SKINCOLOR_CREAM "Gold", // SKINCOLOR_GOLD + "Royal", // SKINCOLOR_ROYAL "Bronze", // SKINCOLOR_BRONZE "Copper", // SKINCOLOR_COPPER "Yellow", // SKINCOLOR_YELLOW @@ -90,18 +92,18 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Handheld", // SKINCOLOR_HANDHELD "Tea", // SKINCOLOR_TEA "Pistachio", // SKINCOLOR_PISTACHIO + "Moss", // SKINCOLOR_MOSS "Camouflage", // SKINCOLOR_CAMOUFLAGE "Robo-Hood", // SKINCOLOR_ROBOHOOD - "Moss", // SKINCOLOR_MOSS "Mint", // SKINCOLOR_MINT "Green", // SKINCOLOR_GREEN "Pinetree", // SKINCOLOR_PINETREE "Emerald", // SKINCOLOR_EMERALD "Swamp", // SKINCOLOR_SWAMP "Dream", // SKINCOLOR_DREAM + "Plague", // SKINCOLOR_PLAGUE "Algae", // SKINCOLOR_ALGAE "Caribbean", // SKINCOLOR_CARIBBEAN - "Plague", // SKINCOLOR_PLAGUE "Aqua", // SKINCOLOR_AQUA "Teal", // SKINCOLOR_TEAL "Cyan", // SKINCOLOR_CYAN @@ -119,20 +121,18 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Blueberry", // SKINCOLOR_BLUEBERRY "Nova", // SKINCOLOR_NOVA "Pastel", // SKINCOLOR_PASTEL + "Moonslam", // SKINCOLOR_MOONSLAM "Ultraviolet", // SKINCOLOR_ULTRAVIOLET "Dusk", // SKINCOLOR_DUSK - "Moonslam", // SKINCOLOR_MOONSLAM "Bubblegum", // SKINCOLOR_BUBBLEGUM "Purple", // SKINCOLOR_PURPLE "Fuchsia", // SKINCOLOR_FUCHSIA "Toxic", // SKINCOLOR_TOXIC "Mauve", // SKINCOLOR_MAUVE - "Royal", // SKINCOLOR_ROYAL "Lavender", // SKINCOLOR_LAVENDER "Byzantium", // SKINCOLOR_BYZANTIUM "Pomegranate", // SKINCOLOR_POMEGRANATE - "Lilac", // SKINCOLOR_LILAC - "Fairy" // SKINCOLOR_FAIRY + "Lilac" // SKINCOLOR_LILAC }; // Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later @@ -144,6 +144,8 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_GREY,8, // SKINCOLOR_GREY SKINCOLOR_SILVER,8, // SKINCOLOR_NICKEL SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK + SKINCOLOR_CAMOUFLAGE,8, // SKINCOLOR_FAIRY + SKINCOLOR_BUBBLEGUM,8, // SKINCOLOR_POPCORN SKINCOLOR_LEATHER,6, // SKINCOLOR_SEPIA SKINCOLOR_BROWN,2, // SKINCOLOR_BEIGE SKINCOLOR_BEIGE,8, // SKINCOLOR_BROWN @@ -171,9 +173,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL - SKINCOLOR_BUBBLEGUM,8, // SKINCOLOR_POPCORN SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD + SKINCOLOR_PLATINUM,6, // SKINCOLOR_ROYAL SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE SKINCOLOR_CREAM,6, // SKINCOLOR_COPPER SKINCOLOR_AQUA,8, // SKINCOLOR_YELLOW @@ -185,18 +187,18 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_CHERRY,8, // SKINCOLOR_HANDHELD SKINCOLOR_SALMON,8, // SKINCOLOR_TEA SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO + SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS SKINCOLOR_FAIRY,10, // SKINCOLOR_CAMOUFLAGE SKINCOLOR_VOMIT,8, // SKINCOLOR_ROBOHOOD - SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT SKINCOLOR_RED,8, // SKINCOLOR_GREEN SKINCOLOR_CRIMSON,8, // SKINCOLOR_PINETREE SKINCOLOR_PURPLE,8, // SKINCOLOR_EMERALD SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM + SKINCOLOR_NOVA,8, // SKINCOLOR_PLAGUE SKINCOLOR_SCARLET,10, // SKINCOLOR_ALGAE SKINCOLOR_FLAME,8, // SKINCOLOR_CARIBBEAN - SKINCOLOR_NOVA,8, // SKINCOLOR_PLAGUE SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUA SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN @@ -214,19 +216,17 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_PUMPKIN,8, // SKINCOLOR_BLUEBERRY SKINCOLOR_PLAGUE,10, // SKINCOLOR_NOVA SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL + SKINCOLOR_SUNSET,10, // SKINCOLOR_MOONSLAM SKINCOLOR_MAUVE,10, // SKINCOLOR_ULTRAVIOLET SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK - SKINCOLOR_SUNSET,10, // SKINCOLOR_MOONSLAM SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC SKINCOLOR_ULTRAVIOLET,8, // SKINCOLOR_MAUVE - SKINCOLOR_PLATINUM,6, // SKINCOLOR_ROYAL SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE - SKINCOLOR_JAWZ,6, // SKINCOLOR_LILAC - SKINCOLOR_CAMOUFLAGE,8 // SKINCOLOR_FAIRY + SKINCOLOR_JAWZ,6 // SKINCOLOR_LILAC }; UINT8 colortranslations[MAXTRANSLATIONS][16] = { @@ -236,6 +236,8 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY { 3, 5, 8, 11, 15, 17, 19, 21, 23, 24, 25, 26, 27, 29, 30, 31}, // SKINCOLOR_NICKEL { 4, 7, 11, 15, 20, 22, 24, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK + {120, 120, 121, 121, 122, 123, 10, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_FAIRY + {120, 96, 97, 98, 99, 71, 32, 11, 13, 16, 18, 21, 23, 26, 28, 31}, // SKINCOLOR_POPCORN { 0, 1, 3, 5, 7, 9, 34, 36, 38, 40, 42, 44, 60, 61, 62, 63}, // SKINCOLOR_SEPIA {120, 65, 67, 69, 32, 34, 36, 38, 40, 42, 44, 45, 46, 47, 62, 63}, // SKINCOLOR_BEIGE { 67, 70, 73, 76, 48, 49, 51, 53, 54, 56, 58, 59, 61, 63, 29, 30}, // SKINCOLOR_BROWN @@ -263,9 +265,9 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE {120, 80, 66, 70, 72, 76, 148, 149, 150, 151, 153, 154, 156, 61, 62, 63}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL - {120, 96, 97, 98, 99, 71, 32, 11, 13, 16, 18, 21, 23, 26, 28, 31}, // SKINCOLOR_POPCORN {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_CREAM {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD + { 97, 112, 113, 113, 114, 78, 53, 252, 252, 253, 253, 254, 255, 29, 30, 31}, // SKINCOLOR_ROYAL {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE {120, 99, 113, 114, 116, 117, 119, 61, 63, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_COPPER { 96, 97, 98, 100, 101, 102, 104, 113, 114, 115, 116, 117, 118, 119, 156, 159}, // SKINCOLOR_YELLOW @@ -277,18 +279,18 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 98, 104, 105, 105, 106, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_HANDHELD {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 + {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS { 64, 66, 69, 32, 34, 37, 40, 182, 171, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_CAMOUFLAGE {120, 176, 160, 165, 167, 168, 169, 182, 182, 171, 60, 61, 63, 29, 30, 31}, // SKINCOLOR_ROBOHOOD - {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN {161, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {160, 184, 185, 186, 187, 188, 189, 190, 191, 191, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM + {176, 160, 184, 185, 186, 187, 188, 230, 230, 206, 206, 207, 28, 29, 30, 31}, // SKINCOLOR_PLAGUE {208, 209, 210, 211, 213, 220, 216, 167, 168, 188, 188, 189, 190, 191, 30, 31}, // SKINCOLOR_ALGAE {120, 176, 177, 160, 185, 220, 216, 217, 221, 230, 206, 206, 254, 255, 29, 31}, // SKINCOLOR_CARIBBEAN - {176, 160, 184, 185, 186, 187, 188, 230, 230, 206, 206, 207, 28, 29, 30, 31}, // SKINCOLOR_PLAGUE {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 {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN @@ -306,21 +308,18 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {226, 228, 229, 230, 232, 233, 235, 237, 239, 240, 242, 244, 246, 31, 31, 31}, // SKINCOLOR_BLUEBERRY {120, 112, 82, 83, 84, 124, 248, 228, 228, 204, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NOVA {120, 208, 209, 210, 211, 226, 202, 249, 194, 195, 196, 197, 198, 199, 255, 30}, // SKINCOLOR_PASTEL + {120, 224, 201, 226, 202, 249, 250, 196, 197, 198, 199, 140, 141, 142, 143, 31}, // SKINCOLOR_MOONSLAM {120, 64, 81, 122, 192, 249, 203, 221, 221, 219, 219, 223, 223, 191, 191, 31}, // SKINCOLOR_ULTRAVIOLET {121, 145, 192, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK - {120, 224, 201, 226, 202, 249, 250, 196, 197, 198, 199, 140, 141, 142, 143, 31}, // SKINCOLOR_MOONSLAM {120, 96, 64, 121, 67, 144, 123, 192, 193, 194, 195, 196, 197, 198, 199, 30}, // SKINCOLOR_BUBBLEGUM {121, 145, 192, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_PURPLE {120, 122, 124, 125, 126, 150, 196, 197, 198, 198, 199, 199, 240, 242, 244, 246}, // SKINCOLOR_FUCHSIA {120, 120, 176, 176, 177, 6, 8, 10, 249, 250, 196, 197, 198, 199, 143, 31}, // SKINCOLOR_TOXIC { 96, 97, 98, 112, 113, 73, 146, 248, 249, 251, 205, 205, 206, 207, 29, 31}, // SKINCOLOR_MAUVE - { 97, 112, 113, 113, 114, 78, 53, 252, 252, 253, 253, 254, 255, 29, 30, 31}, // SKINCOLOR_ROYAL {121, 145, 192, 248, 249, 250, 251, 252, 252, 253, 253, 254, 254, 255, 30, 31}, // SKINCOLOR_LAVENDER {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC - {120, 120, 121, 121, 122, 123, 10, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_FAIRY - // MAXSKINCOLORS {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1 {120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2 {120, 120, 120, 120, 120, 120, 96, 98, 100, 102, 104, 113, 114, 116, 117, 119}, // SKINCOLOR_SUPER3 @@ -366,7 +365,6 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { {120, 120, 120, 120, 120, 120, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3 {120, 120, 120, 120, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4 {120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5 - // MAXTRANSLATIONS }; // Define for getting accurate color brightness readings according to how the human eye sees them. From 33c85f481386b41b7764ee1699896e5ee2bac5a5 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 6 Mar 2019 21:18:01 -0600 Subject: [PATCH 24/81] Clean up the skin_t struct --- src/g_game.c | 8 +++--- src/lua_skinlib.c | 24 ++++++++-------- src/r_things.c | 72 +++++++++++++++++++++++------------------------ src/r_things.h | 28 +++++++++--------- 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 003c11e94..902af57e6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5113,17 +5113,17 @@ void G_GhostTicker(void) INT32 type = -1; if (g->mo->skin) { - skin_t *skin = (skin_t *)g->mo->skin; + //skin_t *skin = (skin_t *)g->mo->skin; switch (ziptic & EZT_THOKMASK) { case EZT_THOK: - type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + type = (UINT32)mobjinfo[MT_PLAYER].painchance; // skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; break; case EZT_SPIN: - type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + type = (UINT32)mobjinfo[MT_PLAYER].damage; // skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; break; case EZT_REV: - type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + type = (UINT32)mobjinfo[MT_PLAYER].raisestate; // skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; break; } } diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index 8fdd92a52..c86376a8e 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -30,24 +30,24 @@ enum skin { skin_facerank, skin_facewant, skin_facemmap, - skin_ability, + /*skin_ability, skin_ability2, skin_thokitem, skin_spinitem, skin_revitem, skin_actionspd, skin_mindash, - skin_maxdash, + skin_maxdash,*/ // SRB2kart skin_kartspeed, skin_kartweight, // - skin_normalspeed, + /*skin_normalspeed, skin_runspeed, skin_thrustfactor, skin_accelstart, skin_acceleration, - skin_jumpfactor, + skin_jumpfactor,*/ skin_starttranscolor, skin_prefcolor, skin_highresscale, @@ -64,24 +64,24 @@ static const char *const skin_opt[] = { "facerank", "facewant", "facemmap", - "ability", + /*"ability", "ability2", "thokitem", "spinitem", "revitem", "actionspd", "mindash", - "maxdash", + "maxdash",*/ // SRB2kart "kartspeed", "kartweight", // - "normalspeed", + /*"normalspeed", "runspeed", "thrustfactor", "accelstart", "acceleration", - "jumpfactor", + "jumpfactor",*/ "starttranscolor", "prefcolor", "highresscale", @@ -139,7 +139,7 @@ static int skin_get(lua_State *L) break; lua_pushlstring(L, skin->facemmap, i); break; - case skin_ability: + /*case skin_ability: lua_pushinteger(L, skin->ability); break; case skin_ability2: @@ -162,7 +162,7 @@ static int skin_get(lua_State *L) break; case skin_maxdash: lua_pushfixed(L, skin->maxdash); - break; + break;*/ // SRB2kart case skin_kartspeed: lua_pushinteger(L, skin->kartspeed); @@ -171,7 +171,7 @@ static int skin_get(lua_State *L) lua_pushinteger(L, skin->kartweight); break; // - case skin_normalspeed: + /*case skin_normalspeed: lua_pushfixed(L, skin->normalspeed); break; case skin_runspeed: @@ -188,7 +188,7 @@ static int skin_get(lua_State *L) break; case skin_jumpfactor: lua_pushfixed(L, skin->jumpfactor); - break; + break;*/ case skin_starttranscolor: lua_pushinteger(L, skin->starttranscolor); break; diff --git a/src/r_things.c b/src/r_things.c index 59a904cbd..be0c0d255 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2537,22 +2537,22 @@ static void Sk_SetDefaultValue(skin_t *skin) skin->kartweight = 5; // - skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; - skin->accelstart = 96; - skin->acceleration = 40; + //skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; + //skin->accelstart = 96; + //skin->acceleration = 40; - skin->ability = CA_NONE; - skin->ability2 = CA2_SPINDASH; - skin->jumpfactor = FRACUNIT; - skin->actionspd = 30<mindash = 15<maxdash = 90<ability = CA_NONE; + //skin->ability2 = CA2_SPINDASH; + //skin->jumpfactor = FRACUNIT; + //skin->actionspd = 30<mindash = 15<maxdash = 90<thokitem = -1; - skin->spinitem = -1; - skin->revitem = -1; + //skin->thokitem = -1; + //skin->spinitem = -1; + //skin->revitem = -1; skin->highresscale = FRACUNIT>>1; @@ -2596,19 +2596,19 @@ void R_InitSkins(void) strncpy(skin->facemmap, "PLAYMMAP", 9); skin->prefcolor = SKINCOLOR_BLUE; - skin->ability = CA_THOK; - skin->actionspd = 60<ability = CA_THOK; + //skin->actionspd = 60<kartspeed = 8; skin->kartweight = 2; // - skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; - skin->accelstart = 96; - skin->acceleration = 40; + //skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; + //skin->accelstart = 96; + //skin->acceleration = 40; skin->spritedef.numframes = sprites[SPR_PLAY].numframes; skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes; @@ -2673,30 +2673,30 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) if (player->mo) player->mo->skin = skin; - player->charability = (UINT8)skin->ability; - player->charability2 = (UINT8)skin->ability2; + //player->charability = (UINT8)skin->ability; + //player->charability2 = (UINT8)skin->ability2; player->charflags = (UINT32)skin->flags; - player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; - player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; - player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + //player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + //player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + //player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; - player->actionspd = skin->actionspd; - player->mindash = skin->mindash; - player->maxdash = skin->maxdash; + //player->actionspd = skin->actionspd; + //player->mindash = skin->mindash; + //player->maxdash = skin->maxdash; // SRB2kart player->kartspeed = skin->kartspeed; player->kartweight = skin->kartweight; - player->normalspeed = skin->normalspeed; - player->runspeed = skin->runspeed; - player->thrustfactor = skin->thrustfactor; - player->accelstart = skin->accelstart; - player->acceleration = skin->acceleration; + //player->normalspeed = skin->normalspeed; + //player->runspeed = skin->runspeed; + //player->thrustfactor = skin->thrustfactor; + //player->accelstart = skin->accelstart; + //player->acceleration = skin->acceleration; - player->jumpfactor = skin->jumpfactor; + //player->jumpfactor = skin->jumpfactor; /*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) { @@ -2906,7 +2906,7 @@ void R_AddSkins(UINT16 wadnum) #define GETSPEED(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)< Date: Wed, 6 Mar 2019 21:30:39 -0600 Subject: [PATCH 25/81] Add -remove option to joinpassword --- src/d_netcmd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a8014ec42..70e6098dd 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3797,12 +3797,20 @@ static void Command_ChangeJoinPassword_f(void) if (COM_Argc() != 2) { - CONS_Printf(M_GetText("joinpassword : set a password to join the server\n")); + CONS_Printf(M_GetText("joinpassword : set a password to join the server\nUse -remove to disable the password.\n")); return; } - D_SetJoinPassword(COM_Argv(1)); - CONS_Printf(M_GetText("Join password set.\n")); + if (strcmp(COM_Argv(1), "-remove") == 0) + { + joinpasswordset = false; + CONS_Printf(M_GetText("Join password removed.\n")); + } + else + { + D_SetJoinPassword(COM_Argv(1)); + CONS_Printf(M_GetText("Join password set.\n")); + } #endif } From 2850ca17df077a2d4a4f78913ff0b98e04b971b8 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 6 Mar 2019 22:02:56 -0600 Subject: [PATCH 26/81] Kill SF_RUNONWATER --- src/d_player.h | 2 +- src/dehacked.c | 2 +- src/p_mobj.c | 2 +- src/r_things.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index a5d73ec70..c93cd9991 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -38,7 +38,7 @@ typedef enum SF_HIRES = 1<<3, // Draw the sprite 2x as small? SF_NOSKID = 1<<4, // No skid particles etc SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust - SF_RUNONWATER = 1<<6, // Run on top of water FOFs? + //SF_RUNONWATER = 1<<6, // Run on top of water FOFs? } skinflags_t; //Primary and secondary skin abilities diff --git a/src/dehacked.c b/src/dehacked.c index e3db120f7..61736bac6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8614,7 +8614,7 @@ struct { {"SF_HIRES",SF_HIRES}, {"SF_NOSKID",SF_NOSKID}, {"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST}, - {"SF_RUNONWATER",SF_RUNONWATER}, + //{"SF_RUNONWATER",SF_RUNONWATER}, // Character abilities! // Primary diff --git a/src/p_mobj.c b/src/p_mobj.c index fd42a1d71..152187cae 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3234,7 +3234,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) #endif *rover->topheight; - if (((player->charflags & SF_RUNONWATER) && player->mo->ceilingz-topheight >= player->mo->height) + if ((/*(player->charflags & SF_RUNONWATER) && */player->mo->ceilingz-topheight >= player->mo->height) && (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) && !(player->pflags & PF_SLIDING) && abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale)) diff --git a/src/r_things.c b/src/r_things.c index be0c0d255..64eb20d2c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -3046,8 +3046,8 @@ next_token: HWR_AddPlayerMD2(numskins); #endif - if (skin->flags & SF_RUNONWATER) // this is literally the only way a skin can be a major mod... this might be a bit heavy handed - G_SetGameModified(multiplayer, true); + /*if (skin->flags & SF_RUNONWATER) // this is literally the only way a skin can be a major mod... this might be a bit heavy handed + G_SetGameModified(multiplayer, true);*/ numskins++; } From 1da3d7cc48dd6515612f8a5a1df547122934d22d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 22:07:28 -0600 Subject: [PATCH 27/81] Fix join password not recognizing shifted characters --- src/d_clisrv.c | 129 ++++++++++++++++++++++++++++++------------------- src/d_clisrv.h | 1 + src/d_main.c | 3 ++ 3 files changed, 83 insertions(+), 50 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index e1c4f8bc0..ca32aaaf5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -22,6 +22,7 @@ #include "i_video.h" #include "d_net.h" #include "d_main.h" +#include "d_event.h" #include "g_game.h" #include "hu_stuff.h" #include "keys.h" @@ -1139,42 +1140,6 @@ static UINT8 cl_challengequestion[17]; static char cl_challengepassword[65]; static UINT8 cl_challengeanswer[17]; -static void D_JoinChallengeInput(INT32 ch) -{ - size_t len; - - while (ch) - { - if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && hu_font[ch-HU_FONTSTART]) - || ch == ' ') // Allow spaces, of course - { - len = strlen(cl_challengepassword); - if (len < 64) - { - cl_challengepassword[len+1] = 0; - cl_challengepassword[len] = ch; - } - } - else if (ch == KEY_BACKSPACE) - { - len = strlen(cl_challengepassword); - - if (len > 0) - cl_challengepassword[len-1] = 0; - } - else if (ch == KEY_ENTER) - { - // Done? - D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_mode = CL_ASKJOIN; - return; - } - - ch = I_GetKey(); - } - -} - // Player name send/load static void CV_SavePlayerNames(UINT8 **p) @@ -2136,22 +2101,10 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic // Call it only once by tic if (*oldtic != I_GetTime()) { - INT32 key; - I_OsPolling(); - key = I_GetKey(); - // Only ESC and non-keyboard keys abort connection - if (key == KEY_ESCAPE || key >= KEY_MOUSE1) - { - CONS_Printf(M_GetText("Network game synchronization aborted.\n")); -// M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress ESC\n"), NULL, MM_NOTHING); - D_QuitNetGame(); - CL_Reset(); - D_StartTitle(); + D_ProcessEvents(); + if (gamestate != GS_WAITINGPLAYERS) return false; - } - else if (cl_mode == CL_CHALLENGE) - D_JoinChallengeInput(key); // why are these here? this is for servers, we're a client //if (key == 's' && server) @@ -2180,6 +2133,82 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic return true; } +boolean CL_Responder(event_t *ev) +{ + size_t len; + INT32 ch; + + if (!(client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)) + return false; // Don't do anything outside of the connection screen + + if (ev->type != ev_keydown) + return false; + + ch = (INT32)ev->data1; + + if (ch == KEY_CAPSLOCK) // it's a toggle. + { + capslock = !capslock; + return true; + } + + // Only ESC and non-keyboard keys abort connection + if (ch == KEY_ESCAPE || ch >= KEY_MOUSE1) + { + CONS_Printf(M_GetText("Network game synchronization aborted.\n")); + //M_StartMessage(M_GetText("Network game synchronization aborted.\n\nPress ESC\n"), NULL, MM_NOTHING); + D_QuitNetGame(); + CL_Reset(); + D_StartTitle(); + return true; + } + + if (cl_mode != CL_CHALLENGE) + return false; + + if ((ch >= HU_FONTSTART && ch <= HU_FONTEND && hu_font[ch-HU_FONTSTART]) + || ch == ' ') // Allow spaces, of course + { + len = strlen(cl_challengepassword); + if (len < 64) + { + + // shifting code stolen from lat by fickle, thx :) + + // I know this looks very messy but this works. If it ain't broke, don't fix it! + // shift LETTERS to uppercase if we have capslock or are holding shift + if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) + { + if (shiftdown ^ capslock) + ch = shiftxform[ch]; + } + else // if we're holding shift we should still shift non letter symbols + { + if (shiftdown) + ch = shiftxform[ch]; + } + + cl_challengepassword[len+1] = 0; + cl_challengepassword[len] = ch; + } + } + else if (ch == KEY_BACKSPACE) + { + len = strlen(cl_challengepassword); + + if (len > 0) + cl_challengepassword[len-1] = 0; + } + else if (ch == KEY_ENTER) + { + // Done? + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_mode = CL_ASKJOIN; + } + + return true; +} + /** Use adaptive send using net_bandwidth and stat.sendbytes * * \param viams ??? diff --git a/src/d_clisrv.h b/src/d_clisrv.h index e4ff7cc74..4d4101308 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -566,6 +566,7 @@ void CL_RemoveSplitscreenPlayer(UINT8 p); void CL_Reset(void); void CL_ClearPlayer(INT32 playernum); void CL_UpdateServerList(boolean internetsearch, INT32 room); +boolean CL_Responder(event_t *ev); // Is there a game running boolean Playing(void); diff --git a/src/d_main.c b/src/d_main.c index 28f89f4f0..92c1e6aed 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -236,6 +236,9 @@ void D_ProcessEvents(void) if (M_ScreenshotResponder(ev)) continue; // ate the event + if (CL_Responder(ev)) + continue; + if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN) { if (cht_Responder(ev)) From 9e9dcf759aa5b544e3aa9eea439ef833670fbf0c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 22:11:35 -0600 Subject: [PATCH 28/81] Show message on incorrect password --- src/d_clisrv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ca32aaaf5..9652561e5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1139,6 +1139,7 @@ static UINT8 cl_challengenum = 0; static UINT8 cl_challengequestion[17]; static char cl_challengepassword[65]; static UINT8 cl_challengeanswer[17]; +static boolean cl_challengeattempted; // Player name send/load @@ -1214,7 +1215,7 @@ static inline void CL_DrawConnectionStatus(void) V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); - cltext = M_GetText("Please enter the server password."); + cltext = M_GetText(cl_challengeattempted ? "Incorrect password. Please try again." : "Please enter the server password."); } break; #ifdef JOININGAME @@ -2191,6 +2192,8 @@ boolean CL_Responder(event_t *ev) cl_challengepassword[len+1] = 0; cl_challengepassword[len] = ch; } + + cl_challengeattempted = false; } else if (ch == KEY_BACKSPACE) { @@ -2198,12 +2201,15 @@ boolean CL_Responder(event_t *ev) if (len > 0) cl_challengepassword[len-1] = 0; + + cl_challengeattempted = false; } else if (ch == KEY_ENTER) { // Done? D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); cl_mode = CL_ASKJOIN; + cl_challengeattempted = true; } return true; @@ -2286,6 +2292,8 @@ static void CL_ConnectToServer(boolean viams) SL_ClearServerList(servernode); #endif + cl_challengeattempted = false; + do { // If the connection was aborted for some reason, leave From ddc296575f953398e4daa4a6ae69bbce18a59608 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 6 Mar 2019 22:28:06 -0600 Subject: [PATCH 29/81] Fix my fuckups Not fond of what I did in P_CanRunOnWater but it at least carries the desired effect... --- src/d_player.h | 1 - src/dehacked.c | 1 - src/g_game.c | 7 ++--- src/lua_skinlib.c | 70 ----------------------------------------------- src/p_mobj.c | 4 +-- src/r_things.c | 70 ----------------------------------------------- src/r_things.h | 18 ------------ 7 files changed, 5 insertions(+), 166 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index c93cd9991..abd7d1669 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -38,7 +38,6 @@ typedef enum SF_HIRES = 1<<3, // Draw the sprite 2x as small? SF_NOSKID = 1<<4, // No skid particles etc SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust - //SF_RUNONWATER = 1<<6, // Run on top of water FOFs? } skinflags_t; //Primary and secondary skin abilities diff --git a/src/dehacked.c b/src/dehacked.c index 61736bac6..34cd86b67 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8614,7 +8614,6 @@ struct { {"SF_HIRES",SF_HIRES}, {"SF_NOSKID",SF_NOSKID}, {"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST}, - //{"SF_RUNONWATER",SF_RUNONWATER}, // Character abilities! // Primary diff --git a/src/g_game.c b/src/g_game.c index 902af57e6..47f50e57b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5113,17 +5113,16 @@ void G_GhostTicker(void) INT32 type = -1; if (g->mo->skin) { - //skin_t *skin = (skin_t *)g->mo->skin; switch (ziptic & EZT_THOKMASK) { case EZT_THOK: - type = (UINT32)mobjinfo[MT_PLAYER].painchance; // skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; + type = (UINT32)mobjinfo[MT_PLAYER].painchance; break; case EZT_SPIN: - type = (UINT32)mobjinfo[MT_PLAYER].damage; // skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; + type = (UINT32)mobjinfo[MT_PLAYER].damage; break; case EZT_REV: - type = (UINT32)mobjinfo[MT_PLAYER].raisestate; // skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; + type = (UINT32)mobjinfo[MT_PLAYER].raisestate; break; } } diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c index c86376a8e..f44e97afe 100644 --- a/src/lua_skinlib.c +++ b/src/lua_skinlib.c @@ -30,24 +30,10 @@ enum skin { skin_facerank, skin_facewant, skin_facemmap, - /*skin_ability, - skin_ability2, - skin_thokitem, - skin_spinitem, - skin_revitem, - skin_actionspd, - skin_mindash, - skin_maxdash,*/ // SRB2kart skin_kartspeed, skin_kartweight, // - /*skin_normalspeed, - skin_runspeed, - skin_thrustfactor, - skin_accelstart, - skin_acceleration, - skin_jumpfactor,*/ skin_starttranscolor, skin_prefcolor, skin_highresscale, @@ -64,24 +50,10 @@ static const char *const skin_opt[] = { "facerank", "facewant", "facemmap", - /*"ability", - "ability2", - "thokitem", - "spinitem", - "revitem", - "actionspd", - "mindash", - "maxdash",*/ // SRB2kart "kartspeed", "kartweight", // - /*"normalspeed", - "runspeed", - "thrustfactor", - "accelstart", - "acceleration", - "jumpfactor",*/ "starttranscolor", "prefcolor", "highresscale", @@ -139,30 +111,6 @@ static int skin_get(lua_State *L) break; lua_pushlstring(L, skin->facemmap, i); break; - /*case skin_ability: - lua_pushinteger(L, skin->ability); - break; - case skin_ability2: - lua_pushinteger(L, skin->ability2); - break; - case skin_thokitem: - lua_pushinteger(L, skin->thokitem); - break; - case skin_spinitem: - lua_pushinteger(L, skin->spinitem); - break; - case skin_revitem: - lua_pushinteger(L, skin->revitem); - break; - case skin_actionspd: - lua_pushfixed(L, skin->actionspd); - break; - case skin_mindash: - lua_pushfixed(L, skin->mindash); - break; - case skin_maxdash: - lua_pushfixed(L, skin->maxdash); - break;*/ // SRB2kart case skin_kartspeed: lua_pushinteger(L, skin->kartspeed); @@ -171,24 +119,6 @@ static int skin_get(lua_State *L) lua_pushinteger(L, skin->kartweight); break; // - /*case skin_normalspeed: - lua_pushfixed(L, skin->normalspeed); - break; - case skin_runspeed: - lua_pushfixed(L, skin->runspeed); - break; - case skin_thrustfactor: - lua_pushinteger(L, skin->thrustfactor); - break; - case skin_accelstart: - lua_pushinteger(L, skin->accelstart); - break; - case skin_acceleration: - lua_pushinteger(L, skin->acceleration); - break; - case skin_jumpfactor: - lua_pushfixed(L, skin->jumpfactor); - break;*/ case skin_starttranscolor: lua_pushinteger(L, skin->starttranscolor); break; diff --git a/src/p_mobj.c b/src/p_mobj.c index 152187cae..c070560fd 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3234,11 +3234,11 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) #endif *rover->topheight; - if ((/*(player->charflags & SF_RUNONWATER) && */player->mo->ceilingz-topheight >= player->mo->height) + if ((player->mo->ceilingz-topheight >= player->mo->height) && (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) && !(player->pflags & PF_SLIDING) && abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale)) - return true; + return false; return false; } diff --git a/src/r_things.c b/src/r_things.c index 64eb20d2c..822643947 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2537,23 +2537,6 @@ static void Sk_SetDefaultValue(skin_t *skin) skin->kartweight = 5; // - //skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; - //skin->accelstart = 96; - //skin->acceleration = 40; - - //skin->ability = CA_NONE; - //skin->ability2 = CA2_SPINDASH; - //skin->jumpfactor = FRACUNIT; - //skin->actionspd = 30<mindash = 15<maxdash = 90<thokitem = -1; - //skin->spinitem = -1; - //skin->revitem = -1; - skin->highresscale = FRACUNIT>>1; for (i = 0; i < sfx_skinsoundslot0; i++) @@ -2596,20 +2579,11 @@ void R_InitSkins(void) strncpy(skin->facemmap, "PLAYMMAP", 9); skin->prefcolor = SKINCOLOR_BLUE; - //skin->ability = CA_THOK; - //skin->actionspd = 60<kartspeed = 8; skin->kartweight = 2; // - //skin->normalspeed = 36<runspeed = 28<thrustfactor = 5; - //skin->accelstart = 96; - //skin->acceleration = 40; - skin->spritedef.numframes = sprites[SPR_PLAY].numframes; skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes; ST_LoadFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, 0); @@ -2673,31 +2647,12 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) if (player->mo) player->mo->skin = skin; - //player->charability = (UINT8)skin->ability; - //player->charability2 = (UINT8)skin->ability2; - player->charflags = (UINT32)skin->flags; - //player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; - //player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; - //player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; - - //player->actionspd = skin->actionspd; - //player->mindash = skin->mindash; - //player->maxdash = skin->maxdash; - // SRB2kart player->kartspeed = skin->kartspeed; player->kartweight = skin->kartweight; - //player->normalspeed = skin->normalspeed; - //player->runspeed = skin->runspeed; - //player->thrustfactor = skin->thrustfactor; - //player->accelstart = skin->accelstart; - //player->acceleration = skin->acceleration; - - //player->jumpfactor = skin->jumpfactor; - /*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) { if (playernum == consoleplayer) @@ -2896,28 +2851,8 @@ void R_AddSkins(UINT16 wadnum) #define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value); // character type identification FULLPROCESS(flags) - //FULLPROCESS(ability) - //FULLPROCESS(ability2) - - //FULLPROCESS(thokitem) - //FULLPROCESS(spinitem) - //FULLPROCESS(revitem) #undef FULLPROCESS -#define GETSPEED(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<field = atoi(value); - GETINT(thrustfactor) - GETINT(accelstart) - GETINT(acceleration) -#undef GETINT*/ - #define GETKARTSTAT(field) \ else if (!stricmp(stoken, #field)) \ { \ @@ -2935,8 +2870,6 @@ void R_AddSkins(UINT16 wadnum) else if (!stricmp(stoken, "prefcolor")) skin->prefcolor = K_GetKartColorByName(value); - //else if (!stricmp(stoken, "jumpfactor")) - //skin->jumpfactor = FLOAT_TO_FIXED(atof(value)); else if (!stricmp(stoken, "highresscale")) skin->highresscale = FLOAT_TO_FIXED(atof(value)); else @@ -3046,9 +2979,6 @@ next_token: HWR_AddPlayerMD2(numskins); #endif - /*if (skin->flags & SF_RUNONWATER) // this is literally the only way a skin can be a major mod... this might be a bit heavy handed - G_SetGameModified(multiplayer, true);*/ - numskins++; } return; diff --git a/src/r_things.h b/src/r_things.h index b4993fe89..6f48cc5bf 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -83,29 +83,11 @@ typedef struct char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long) char facerank[9], facewant[9], facemmap[9]; // Arbitrarily named patch lumps - //UINT8 ability; // ability definition - //UINT8 ability2; // secondary ability definition - //INT32 thokitem; - //INT32 spinitem; - //INT32 revitem; - //fixed_t actionspd; - //fixed_t mindash; - //fixed_t maxdash; - // SRB2kart UINT8 kartspeed; UINT8 kartweight; // - //fixed_t normalspeed; // Normal ground - //fixed_t runspeed; // Speed that you break into your run animation - - //UINT8 thrustfactor; // Thrust = thrustfactor * acceleration - //UINT8 accelstart; // Acceleration if speed = 0 - //UINT8 acceleration; // Acceleration - - //fixed_t jumpfactor; // multiple of standard jump height - // Definable color translation table UINT8 starttranscolor; UINT8 prefcolor; From b696e68def6aa9e5bb4cf6db4dfa5291dea6c344 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 22:36:13 -0600 Subject: [PATCH 30/81] Recycle oldest challenges first if all are taken --- src/d_clisrv.c | 1 + src/d_netcmd.c | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 9652561e5..8e97ca1c7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2235,6 +2235,7 @@ static void CL_ConnectToServer(boolean viams) #endif cl_mode = CL_SEARCHING; + cl_challengenum = 0; #ifdef CLIENT_LOADINGSCREEN lastfilenum = -1; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 70e6098dd..789c505ec 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3710,7 +3710,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) static UINT8 joinpassmd5[17]; static boolean joinpasswordset = false; static UINT8 joinpasschallenges[NUMJOINCHALLENGES][17]; -static boolean joinpasschallengeson[NUMJOINCHALLENGES]; +static tic_t joinpasschallengeson[NUMJOINCHALLENGES]; boolean D_IsJoinPasswordOn(void) { @@ -3745,12 +3745,12 @@ boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer) num %= NUMJOINCHALLENGES; //@TODO use a constant-time memcmp.... - if (joinpasschallengeson[num] && memcmp(answer, joinpasschallenges[num], 16) == 0) + if (joinpasschallengeson[num] > 0 && memcmp(answer, joinpasschallenges[num], 16) == 0) passed = true; // Wipe and reset the challenge so that it can't be tried against again, as a small measure against brute-force attacks. memset(joinpasschallenges[num], 0x00, 17); - joinpasschallengeson[num] = false; + joinpasschallengeson[num] = 0; return passed; } @@ -3763,12 +3763,26 @@ void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question) { (*num) = M_RandomKey(NUMJOINCHALLENGES); - if (!joinpasschallengeson[(*num)]) + if (joinpasschallengeson[(*num)] == 0) break; } - // If the above loop never breaks, then uh.... we're obliterating one random stored challenge. Sorry (: - joinpasschallengeson[(*num)] = true; + if (joinpasschallengeson[(*num)] > 0) + { + // Ugh, all challenges are (probably) taken. Let's find the oldest one and overwrite it. + tic_t oldesttic = INT32_MAX; + + for (i = 0; i < NUMJOINCHALLENGES; i++) + { + if (joinpasschallengeson[i] < oldesttic) + { + (*num) = i; + oldesttic = joinpasschallengeson[i]; + } + } + } + + joinpasschallengeson[(*num)] = I_GetTime(); memset(question, 0x00, 17); for (i = 0; i < 16; i++) From d013c9117c5a379bf69c13a050ce56a3371841e2 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 22:45:02 -0600 Subject: [PATCH 31/81] Missed an include --- src/d_clisrv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 4d4101308..55ff0749c 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -13,6 +13,7 @@ #ifndef __D_CLISRV__ #define __D_CLISRV__ +#include "d_event.h" #include "d_ticcmd.h" #include "d_netcmd.h" #include "tables.h" From 8a022670bd451b1259acae58c5603d79971b5a9c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 23:32:47 -0600 Subject: [PATCH 32/81] Fix freeze when trying to host with a join password already set --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 8e97ca1c7..ed6939e21 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3733,7 +3733,7 @@ static void HandleConnect(SINT8 node) boolean newnode = false; #endif - if (D_IsJoinPasswordOn()) + if (node != servernode && D_IsJoinPasswordOn()) { // Ensure node sent the correct password challenge boolean passed = false; From 96b47d3065c7cfa693c6a7cc5920d321038ef457 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 23:34:30 -0600 Subject: [PATCH 33/81] Don't shoot asterisks off-screen on the join password screen --- src/d_clisrv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ed6939e21..b10704266 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1207,11 +1207,11 @@ static inline void CL_DrawConnectionStatus(void) { case CL_CHALLENGE: { - char asterisks[65]; - size_t sl = strlen(cl_challengepassword); + char asterisks[33]; + size_t sl = min(32, strlen(cl_challengepassword)); memset(asterisks, '*', sl); - memset(asterisks+sl, 0, 65-sl); + memset(asterisks+sl, 0, 33-sl); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); From 4698130321ba9c9df2158f03b48de59fa8d21228 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 7 Mar 2019 18:20:57 -0500 Subject: [PATCH 34/81] Fix unused function error --- src/sdl/i_video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 0568dcee4..10c78c71e 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1325,7 +1325,7 @@ void I_UpdateNoBlit(void) // // Returns true if it thinks we can afford to skip this frame // from PrBoom's src/SDL/i_video.c -static inline boolean I_SkipFrame(void) +/*static inline boolean I_SkipFrame(void) { static boolean skip = false; @@ -1340,12 +1340,12 @@ static inline boolean I_SkipFrame(void) if (!paused) return false; /* FALLTHRU */ - case GS_WAITINGPLAYERS: + /*case GS_WAITINGPLAYERS: return skip; // Skip odd frames default: return false; } -} +}*/ // // I_FinishUpdate From db07eddb3aa0fac3426a14b1788add2d832dd73b Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 7 Mar 2019 18:52:27 -0500 Subject: [PATCH 35/81] Properly comment out the function --- src/sdl/i_video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 10c78c71e..53aa351c3 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1325,7 +1325,8 @@ void I_UpdateNoBlit(void) // // Returns true if it thinks we can afford to skip this frame // from PrBoom's src/SDL/i_video.c -/*static inline boolean I_SkipFrame(void) +#if 0 +static inline boolean I_SkipFrame(void) { static boolean skip = false; @@ -1340,12 +1341,13 @@ void I_UpdateNoBlit(void) if (!paused) return false; /* FALLTHRU */ - /*case GS_WAITINGPLAYERS: + case GS_WAITINGPLAYERS: return skip; // Skip odd frames default: return false; } -}*/ +} +#endif // // I_FinishUpdate From c9aab2579b654d8bb3072655e1571c0badd999db Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 8 Mar 2019 18:36:25 -0500 Subject: [PATCH 36/81] Kill invincibility item caps It's a holdover from another era, our item changes have stacked up enough that we don't really need this cap anymore --- src/k_kart.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d4d2cc649..d5b8fb53e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -725,7 +725,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp const INT32 distvar = (64*14); INT32 newodds; INT32 i; - UINT8 pingame = 0, pexiting = 0, pinvin = 0; + UINT8 pingame = 0, pexiting = 0; boolean thunderisout = false; SINT8 first = -1, second = -1; INT32 secondist = 0; @@ -780,12 +780,6 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp if (players[i].mo) { - if (players[i].kartstuff[k_itemtype] == KITEM_INVINCIBILITY - || players[i].kartstuff[k_itemtype] == KITEM_GROW - || players[i].kartstuff[k_invincibilitytimer] - || players[i].kartstuff[k_growshrinktimer] > 0) - pinvin++; - if (players[i].kartstuff[k_itemtype] == KITEM_THUNDERSHIELD) thunderisout = true; @@ -831,13 +825,6 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp switch (item) { - case KITEM_INVINCIBILITY: - case KITEM_GROW: - if (pinvin >= max(1, (pingame+3) / 4) || COOLDOWNONSTART) - newodds = 0; - else - POWERITEMODDS(newodds); - break; case KITEM_ROCKETSNEAKER: case KITEM_JAWZ: case KITEM_BALLHOG: @@ -849,7 +836,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp case KRITEM_DUALJAWZ: POWERITEMODDS(newodds); break; + case KITEM_INVINCIBILITY: case KITEM_MINE: + case KITEM_GROW: if (COOLDOWNONSTART) newodds = 0; else From 32fbfc9159ec50f396bfe3d65b2ce105fcdc9303 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 8 Mar 2019 18:51:55 -0500 Subject: [PATCH 37/81] Always return false instead. --- src/sdl/i_video.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 53aa351c3..f64a429a0 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1325,9 +1325,9 @@ void I_UpdateNoBlit(void) // // Returns true if it thinks we can afford to skip this frame // from PrBoom's src/SDL/i_video.c -#if 0 static inline boolean I_SkipFrame(void) { +#if 0 static boolean skip = false; if (rendermode != render_soft) @@ -1346,8 +1346,9 @@ static inline boolean I_SkipFrame(void) default: return false; } -} #endif + return false; +} // // I_FinishUpdate @@ -1357,9 +1358,8 @@ void I_FinishUpdate(void) if (rendermode == render_none) return; //Alam: No software or OpenGl surface - // Don't skip frames - //if (I_SkipFrame()) - //return; + if (I_SkipFrame()) + return; if (cv_ticrate.value) SCR_DisplayTicRate(); From ff32e84b09d800880debcb581c72862780f86d01 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 8 Mar 2019 19:06:27 -0500 Subject: [PATCH 38/81] Fix macro expansion warning Sryder got --- src/k_kart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d4d2cc649..aaf77ff33 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -820,12 +820,13 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp #define PLAYERSCALING (8 - (spbrush ? 2 : pingame)) -#define POWERITEMODDS(odds) \ +#define POWERITEMODDS(odds) {\ if (franticitems) \ odds <<= 1; \ odds = FixedMul(odds<> FRACBITS; \ if (mashed > 0) \ - odds = FixedDiv(odds<> FRACBITS \ + odds = FixedDiv(odds<> FRACBITS; \ +} #define COOLDOWNONSTART (leveltime < (30*TICRATE)+starttime) From 055d73c1e7d1bcd816018f91ced969ebea530533 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 12:01:47 -0600 Subject: [PATCH 39/81] Move HandleConnect to the same place as other packets --- src/d_clisrv.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index b10704266..1afbe89eb 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3916,6 +3916,10 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; + case PT_CLIENTJOIN: + if (server) + HandleConnect(node); + break; case PT_JOINCHALLENGE: if (server && serverrunning) { // But wait I thought I'm the server? @@ -4592,12 +4596,6 @@ FILESTAMP while (HGetPacket()) { node = (SINT8)doomcom->remotenode; - - if (netbuffer->packettype == PT_CLIENTJOIN && server) - { - HandleConnect(node); - continue; - } if (node == servernode && client && cl_mode != CL_SEARCHING) { if (netbuffer->packettype == PT_SERVERSHUTDOWN) From 283bb3aa662b56c95df594383d6adeb0a71e563b Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 13:30:22 -0600 Subject: [PATCH 40/81] Check password and etc before downloading files --- src/d_clisrv.c | 85 ++++++++++++++++++++++++++++++++++++++++++++------ src/d_clisrv.h | 3 +- src/d_net.c | 2 +- 3 files changed, 79 insertions(+), 11 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1afbe89eb..37282519f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1128,18 +1128,21 @@ typedef enum #endif CL_CONNECTED, CL_ABORTED, + CL_ASKDOWNLOADFILES, + CL_WAITDOWNLOADFILESRESPONSE, CL_CHALLENGE } cl_mode_t; static void GetPackets(void); static cl_mode_t cl_mode = CL_SEARCHING; +static boolean cl_needsdownload = false; static UINT8 cl_challengenum = 0; static UINT8 cl_challengequestion[17]; static char cl_challengepassword[65]; static UINT8 cl_challengeanswer[17]; -static boolean cl_challengeattempted; +static UINT8 cl_challengeattempted = 0; // Player name send/load @@ -1237,6 +1240,9 @@ static inline void CL_DrawConnectionStatus(void) case CL_WAITJOINRESPONSE: cltext = M_GetText("Requesting to join..."); break; + case CL_ASKDOWNLOADFILES: + case CL_WAITDOWNLOADFILESRESPONSE: + cltext = M_GetText("Waiting to download files..."); default: cltext = M_GetText("Connecting to server..."); break; @@ -1314,6 +1320,7 @@ static boolean CL_SendJoin(void) netbuffer->u.clientcfg.localplayers = localplayers; netbuffer->u.clientcfg.version = VERSION; netbuffer->u.clientcfg.subversion = SUBVERSION; + netbuffer->u.clientcfg.needsdownload = cl_needsdownload; netbuffer->u.clientcfg.challengenum = cl_challengenum; memcpy(netbuffer->u.clientcfg.challengeanswer, cl_challengeanswer, 16); @@ -1989,9 +1996,12 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) ), NULL, MM_NOTHING); return false; } + + cl_mode = CL_ASKDOWNLOADFILES; + // no problem if can't send packet, we will retry later - if (CL_SendRequestFile()) - cl_mode = CL_DOWNLOADFILES; + //if (CL_SendRequestFile()) + // cl_mode = CL_DOWNLOADFILES; } } else @@ -2059,6 +2069,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic /* FALLTHRU */ case CL_ASKJOIN: + cl_needsdownload = false; CL_LoadServerFiles(); #ifdef JOININGAME // prepare structures to save the file @@ -2070,6 +2081,14 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic cl_mode = CL_WAITJOINRESPONSE; break; + case CL_ASKDOWNLOADFILES: + cl_needsdownload = true; + + if (CL_SendJoin()) + cl_mode = CL_WAITDOWNLOADFILESRESPONSE; + break; + + #ifdef JOININGAME case CL_DOWNLOADSAVEGAME: // At this state, the first (and only) needed file is the gamestate @@ -2085,6 +2104,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic case CL_CHALLENGE: case CL_WAITJOINRESPONSE: + case CL_WAITDOWNLOADFILESRESPONSE: case CL_CONNECTED: default: break; @@ -2193,7 +2213,7 @@ boolean CL_Responder(event_t *ev) cl_challengepassword[len] = ch; } - cl_challengeattempted = false; + cl_challengeattempted = 0; } else if (ch == KEY_BACKSPACE) { @@ -2202,14 +2222,14 @@ boolean CL_Responder(event_t *ev) if (len > 0) cl_challengepassword[len-1] = 0; - cl_challengeattempted = false; + cl_challengeattempted = 0; } else if (ch == KEY_ENTER) { // Done? D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_mode = CL_ASKJOIN; - cl_challengeattempted = true; + cl_mode = cl_needsdownload ? CL_ASKDOWNLOADFILES : CL_ASKJOIN; + cl_challengeattempted = 1; } return true; @@ -2293,7 +2313,7 @@ static void CL_ConnectToServer(boolean viams) SL_ClearServerList(servernode); #endif - cl_challengeattempted = false; + cl_challengeattempted = 0; do { @@ -3753,6 +3773,13 @@ static void HandleConnect(SINT8 node) } } + if (netbuffer->u.clientcfg.needsdownload) + { + netbuffer->packettype = PT_DOWNLOADFILESOKAY; + HSendPacket(node, true, 0, 0); + return; + } + // client authorised to join nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]); if (!nodeingame[node]) @@ -3761,6 +3788,7 @@ static void HandleConnect(SINT8 node) #ifndef NONET newnode = true; #endif + SV_AddNode(node); /// \note Wait what??? @@ -3927,12 +3955,19 @@ static void HandlePacketFromAwayNode(SINT8 node) break; } SERVERONLY - if (cl_mode == CL_WAITJOINRESPONSE) + if (cl_mode == CL_WAITJOINRESPONSE || cl_mode == CL_WAITDOWNLOADFILESRESPONSE) { cl_challengenum = netbuffer->u.joinchallenge.challengenum; memcpy(cl_challengequestion, netbuffer->u.joinchallenge.question, 16); cl_mode = CL_CHALLENGE; + + if (cl_challengeattempted == 2) + { + // We already sent a correct password, so throw it back up again. + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_mode = CL_ASKJOIN; + } } break; @@ -3964,6 +3999,38 @@ static void HandlePacketFromAwayNode(SINT8 node) } break; + case PT_DOWNLOADFILESOKAY: + if (server && serverrunning) + { // But wait I thought I'm the server? + Net_CloseConnection(node); + break; + } + + SERVERONLY + + // This should've already been checked, but just to be safe... + if (!CL_CheckDownloadable()) + { + D_QuitNetGame(); + CL_Reset(); + D_StartTitle(); + M_StartMessage(M_GetText( + "You cannot connect to this server\n" + "because you cannot download the files\n" + "that you are missing from the server.\n\n" + "See the console or log file for\n" + "more details.\n\n" + "Press ESC\n" + ), NULL, MM_NOTHING); + break; + } + + cl_challengeattempted = 2; + CONS_Printf("trying to download\n"); + if (CL_SendRequestFile()) + cl_mode = CL_DOWNLOADFILES; + break; + case PT_SERVERCFG: // Positive response of client join request { INT32 j; diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 55ff0749c..59a0b5c6a 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -75,6 +75,7 @@ typedef enum PT_BASICKEEPALIVE,// Keep the network alive during wipes, as tics aren't advanced and NetUpdate isn't called PT_JOINCHALLENGE, // You must give a password to joinnnnn + PT_DOWNLOADFILESOKAY, // You can download files from the server.... PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL // allows HSendPacket(*, true, *, *) to return false. @@ -356,7 +357,7 @@ typedef struct UINT8 version; // Different versions don't work UINT8 subversion; // Contains build version UINT8 localplayers; - UINT8 mode; + UINT8 needsdownload; UINT8 challengenum; // Non-zero if trying to join with a password attempt UINT8 challengeanswer[16]; // Join challenge } ATTRPACK clientconfig_pak; diff --git a/src/d_net.c b/src/d_net.c index 6702a60a4..530ee6df0 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -868,7 +868,7 @@ static void DebugPrintpacket(const char *header) break; case PT_CLIENTJOIN: fprintf(debugfile, " number %d mode %d\n", netbuffer->u.clientcfg.localplayers, - netbuffer->u.clientcfg.mode); + netbuffer->u.clientcfg.needsdownload); break; case PT_SERVERTICS: { From 640b9016d7ed10c8777538e308e9ddb936cb45b3 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 14:30:04 -0600 Subject: [PATCH 41/81] Show kartspeed and password status on server browser --- src/d_clisrv.c | 8 +++++++- src/d_clisrv.h | 6 +++++- src/m_menu.c | 13 ++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 37282519f..6ff024cd2 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1343,7 +1343,13 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.gametype = (UINT8)(G_BattleGametype() ? VANILLA_GT_MATCH : VANILLA_GT_RACE); // SRB2Kart: Vanilla's gametype constants for MS support netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame; netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); - netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated; + + netbuffer->u.serverinfo.kartvars = (UINT8) ( + cv_kartspeed.value | + (dedicated ? SV_DEDICATED : 0) | + (D_IsJoinPasswordOn() ? SV_PASSWORD : 0) + ); + strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, MAXSERVERNAME); strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 59a0b5c6a..2937e882d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -368,6 +368,10 @@ typedef struct UINT8 question[16]; // Challenge data to be manipulated and answered with } ATTRPACK joinchallenge_pak; +#define SV_SPEEDMASK 0x03 +#define SV_DEDICATED 0x40 +#define SV_PASSWORD 0x80 + #define MAXSERVERNAME 32 #define MAXFILENEEDED 915 // This packet is too large @@ -380,7 +384,7 @@ typedef struct UINT8 gametype; UINT8 modifiedgame; UINT8 cheatsenabled; - UINT8 isdedicated; + UINT8 kartvars; // Previously isdedicated, now appropriated for our own nefarious purposes UINT8 fileneedednum; SINT8 adminplayer; tic_t time; diff --git a/src/m_menu.c b/src/m_menu.c index 57a73c146..23e6ede48 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7241,6 +7241,7 @@ static void M_DrawConnectMenu(void) { UINT16 i, j; const char *gt = "Unknown"; + const char *spd = ""; INT32 numPages = (serverlistcount+(SERVERS_PER_PAGE-1))/SERVERS_PER_PAGE; for (i = FIRSTSERVERLINE; i < min(localservercount, SERVERS_PER_PAGE)+FIRSTSERVERLINE; i++) @@ -7294,7 +7295,17 @@ static void M_DrawConnectMenu(void) V_DrawSmallString(currentMenu->x+46,S_LINEY(i)+8, globalflags, va("Players: %02d/%02d", serverlist[slindex].info.numberofplayer, serverlist[slindex].info.maxplayer)); - V_DrawSmallString(currentMenu->x+112, S_LINEY(i)+8, globalflags, va("Gametype: %s", gt)); + V_DrawSmallString(currentMenu->x+112, S_LINEY(i)+8, globalflags, gt); + + if (serverlist[slindex].info.gametype == GT_RACE) + { + spd = kartspeed_cons_t[serverlist[slindex].info.kartvars & SV_SPEEDMASK].strvalue; + + V_DrawSmallString(currentMenu->x+132, S_LINEY(i)+8, globalflags, va("(%s Speed)", spd)); + } + + if (serverlist[slindex].info.kartvars & SV_PASSWORD) + V_DrawFixedPatch((currentMenu->x - 10) << FRACBITS, (S_LINEY(i)) << FRACBITS, FRACUNIT, globalflags & (~V_ALLOWLOWERCASE), W_CachePatchName("SERVLOCK", PU_CACHE), NULL); MP_ConnectMenu[i+FIRSTSERVERLINE].status = IT_STRING | IT_CALL; } From 180bc0eaeed08921f4c6695eb40775666cc275ce Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 15:00:48 -0600 Subject: [PATCH 42/81] Add join password to server host menu --- src/d_netcmd.c | 5 ++++- src/d_netcmd.h | 2 ++ src/m_menu.c | 34 +++++++++++++++++++++++++++------- src/m_menu.h | 1 + 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 789c505ec..451e97624 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -535,6 +535,7 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_PICKVOTE, Got_PickVotecmd); // Remote Administration + CV_RegisterVar(&cv_dummyjoinpassword); COM_AddCommand("joinpassword", Command_ChangeJoinPassword_f); COM_AddCommand("password", Command_Changepassword_f); RegisterNetXCmd(XD_LOGIN, Got_Login); @@ -3706,9 +3707,11 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) } // Join password stuff +consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; + #define NUMJOINCHALLENGES 32 static UINT8 joinpassmd5[17]; -static boolean joinpasswordset = false; +boolean joinpasswordset = false; static UINT8 joinpasschallenges[NUMJOINCHALLENGES][17]; static tic_t joinpasschallengeson[NUMJOINCHALLENGES]; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 438ba3ff1..166c5e008 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -248,6 +248,8 @@ void RemoveAdminPlayer(INT32 playernum); void ItemFinder_OnChange(void); void D_SetPassword(const char *pw); +extern consvar_t cv_dummyjoinpassword; +extern boolean joinpasswordset; boolean D_IsJoinPasswordOn(void); void D_ComputeChallengeAnswer(UINT8 *question, const char *pw, UINT8 *answer); void D_SetJoinPassword(const char *pw); diff --git a/src/m_menu.c b/src/m_menu.c index 23e6ede48..83bec981e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -948,14 +948,15 @@ static menuitem_t MP_MainMenu[] = static menuitem_t MP_ServerMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 10}, - {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20}, - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30}, + {IT_STRING|IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 0}, + {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 10}, + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 20}, + {IT_STRING|IT_CVAR|IT_CV_PASSWORD, NULL, "Password", &cv_dummyjoinpassword, 44}, - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, }; #endif @@ -2682,7 +2683,7 @@ boolean M_Responder(event_t *ev) // BP: one of the more big hack i have never made if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR) { - if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING) + if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING || (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) { if (shiftdown && ch >= 32 && ch <= 127) ch = shiftxform[ch]; @@ -3557,6 +3558,8 @@ static void M_DrawGenericMenu(void) case IT_CVAR: { consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction; + char asterisks[MAXSTRINGLENGTH+1]; + size_t sl; switch (currentMenu->menuitems[i].status & IT_CVARTYPE) { case IT_CV_SLIDER: @@ -3572,6 +3575,18 @@ static void M_DrawGenericMenu(void) '_' | 0x80, false); y += 16; break; + case IT_CV_PASSWORD: + sl = strlen(cv->string); + memset(asterisks, '*', sl); + memset(asterisks + sl, 0, MAXSTRINGLENGTH+1-sl); + + M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); + V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, asterisks); + if (skullAnimCounter < 4 && i == itemOn) + V_DrawCharacter(x + 8 + V_StringWidth(asterisks, 0), y + 12, + '_' | 0x80, false); + y += 16; + break; default: w = V_StringWidth(cv->string, 0); V_DrawString(BASEVIDWIDTH - x - w, y, @@ -7540,6 +7555,11 @@ static void M_StartServer(INT32 choice) // Still need to reset devmode cv_debug = 0; + if (strlen(cv_dummyjoinpassword.string) > 0) + D_SetJoinPassword(cv_dummyjoinpassword.string); + else + joinpasswordset = false; + if (demoplayback) G_StopDemo(); if (metalrecording) diff --git a/src/m_menu.h b/src/m_menu.h index 864f4cacc..06ae7114a 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -104,6 +104,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt); #define IT_CV_NOPRINT 1536 #define IT_CV_NOMOD 2048 #define IT_CV_INVISSLIDER 2560 +#define IT_CV_PASSWORD 3072 //call/submenu specific // There used to be a lot more here but ... From dca6d8094a50f99c89c55f3852d73fd5a0ee43f3 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 9 Mar 2019 22:01:52 +0100 Subject: [PATCH 43/81] Change default showping from Warning to Always --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 53d88f2f7..95492f3b4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -441,7 +441,7 @@ consvar_t cv_pingtimeout = {"pingtimeout", "10", CV_SAVE, pingtimeout_cons_t, NU // show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; -consvar_t cv_showping = {"showping", "Warning", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_showping = {"showping", "Always", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif // Intermission time Tails 04-19-2002 From d711e395181b83ef182f49b57de540a3ec706882 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 15:14:08 -0600 Subject: [PATCH 44/81] Toggle showing password with tab --- src/m_menu.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 83bec981e..dd035388a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2384,6 +2384,9 @@ static void M_NextOpt(void) { INT16 oldItemOn = itemOn; // prevent infinite loop + if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) + ((consvar_t *)currentMenu->menuitems[itemOn].itemaction)->value = 0; + do { if (itemOn + 1 > currentMenu->numitems - 1) @@ -2397,6 +2400,9 @@ static void M_PrevOpt(void) { INT16 oldItemOn = itemOn; // prevent infinite loop + if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) + ((consvar_t *)currentMenu->menuitems[itemOn].itemaction)->value = 0; + do { if (!itemOn) @@ -2685,6 +2691,9 @@ boolean M_Responder(event_t *ev) { if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING || (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) { + if (ch == KEY_TAB) + ((consvar_t *)currentMenu->menuitems[itemOn].itemaction)->value ^= 1; + if (shiftdown && ch >= 32 && ch <= 127) ch = shiftxform[ch]; if (M_ChangeStringCvar(ch)) @@ -3567,6 +3576,27 @@ static void M_DrawGenericMenu(void) case IT_CV_NOPRINT: // color use this case IT_CV_INVISSLIDER: // monitor toggles use this break; + case IT_CV_PASSWORD: + if (i == itemOn) + { + V_DrawRightAlignedThinString(x + MAXSTRINGLENGTH*8 + 10, y, V_ALLOWLOWERCASE, va(M_GetText("Tab: %s password"), cv->value ? "hide" : "show")); + } + + if (!cv->value || i != itemOn) + { + sl = strlen(cv->string); + memset(asterisks, '*', sl); + memset(asterisks + sl, 0, MAXSTRINGLENGTH+1-sl); + + M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); + V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, asterisks); + if (skullAnimCounter < 4 && i == itemOn) + V_DrawCharacter(x + 8 + V_StringWidth(asterisks, 0), y + 12, + '_' | 0x80, false); + y += 16; + break; + } + /* fallthru */ case IT_CV_STRING: M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string); @@ -3575,18 +3605,6 @@ static void M_DrawGenericMenu(void) '_' | 0x80, false); y += 16; break; - case IT_CV_PASSWORD: - sl = strlen(cv->string); - memset(asterisks, '*', sl); - memset(asterisks + sl, 0, MAXSTRINGLENGTH+1-sl); - - M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); - V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, asterisks); - if (skullAnimCounter < 4 && i == itemOn) - V_DrawCharacter(x + 8 + V_StringWidth(asterisks, 0), y + 12, - '_' | 0x80, false); - y += 16; - break; default: w = V_StringWidth(cv->string, 0); V_DrawString(BASEVIDWIDTH - x - w, y, From d4f340ff7b61e396ec2af301d049ce417c914e9b Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 15:27:23 -0600 Subject: [PATCH 45/81] Nudge lock over a tad --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index dd035388a..881b6682a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7338,7 +7338,7 @@ static void M_DrawConnectMenu(void) } if (serverlist[slindex].info.kartvars & SV_PASSWORD) - V_DrawFixedPatch((currentMenu->x - 10) << FRACBITS, (S_LINEY(i)) << FRACBITS, FRACUNIT, globalflags & (~V_ALLOWLOWERCASE), W_CachePatchName("SERVLOCK", PU_CACHE), NULL); + V_DrawFixedPatch((currentMenu->x - 9) << FRACBITS, (S_LINEY(i)) << FRACBITS, FRACUNIT, globalflags & (~V_ALLOWLOWERCASE), W_CachePatchName("SERVLOCK", PU_CACHE), NULL); MP_ConnectMenu[i+FIRSTSERVERLINE].status = IT_STRING | IT_CALL; } From f388416264f4af2f0048beaa755f893fd9486497 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 16:46:55 -0600 Subject: [PATCH 46/81] Use consts in place of some 16s --- src/d_clisrv.h | 4 ++-- src/d_netcmd.c | 36 ++++++++++++++++++------------------ src/md5.h | 2 ++ src/w_wad.c | 1 - 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 2937e882d..d979fb287 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -359,13 +359,13 @@ typedef struct UINT8 localplayers; UINT8 needsdownload; UINT8 challengenum; // Non-zero if trying to join with a password attempt - UINT8 challengeanswer[16]; // Join challenge + UINT8 challengeanswer[MD5_LEN]; // Join challenge } ATTRPACK clientconfig_pak; typedef struct { UINT8 challengenum; // Number to send back in join attempt - UINT8 question[16]; // Challenge data to be manipulated and answered with + UINT8 question[MD5_LEN]; // Challenge data to be manipulated and answered with } ATTRPACK joinchallenge_pak; #define SV_SPEEDMASK 0x03 diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 451e97624..abc319498 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3444,7 +3444,7 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, } #define BASESALT "basepasswordstorage" -static UINT8 adminpassmd5[16]; +static UINT8 adminpassmd5[MD5_LEN]; static boolean adminpasswordset = false; void D_SetPassword(const char *pw) @@ -3483,7 +3483,7 @@ static void Command_Login_f(void) // If we have no MD5 support then completely disable XD_LOGIN responses for security. CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n"); #else - XBOXSTATIC UINT8 finalmd5[16]; + XBOXSTATIC UINT8 finalmd5[MD5_LEN]; const char *pw; if (!netgame) @@ -3506,11 +3506,11 @@ static void Command_Login_f(void) D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &finalmd5); // Do the final pass to get the comparison the server will come up with - D_MD5PasswordPass(finalmd5, 16, va("PNUM%02d", consoleplayer), &finalmd5); + D_MD5PasswordPass(finalmd5, MD5_LEN, va("PNUM%02d", consoleplayer), &finalmd5); CONS_Printf(M_GetText("Sending login... (Notice only given if password is correct.)\n")); - SendNetXCmd(XD_LOGIN, finalmd5, 16); + SendNetXCmd(XD_LOGIN, finalmd5, MD5_LEN); #endif } @@ -3521,9 +3521,9 @@ static void Got_Login(UINT8 **cp, INT32 playernum) (void)cp; (void)playernum; #else - UINT8 sentmd5[16], finalmd5[16]; + UINT8 sentmd5[MD5_LEN], finalmd5[MD5_LEN]; - READMEM(*cp, sentmd5, 16); + READMEM(*cp, sentmd5, MD5_LEN); if (client) return; @@ -3535,9 +3535,9 @@ static void Got_Login(UINT8 **cp, INT32 playernum) } // Do the final pass to compare with the sent md5 - D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5); + D_MD5PasswordPass(adminpassmd5, MD5_LEN, va("PNUM%02d", playernum), &finalmd5); - if (!memcmp(sentmd5, finalmd5, 16)) + if (!memcmp(sentmd5, finalmd5, MD5_LEN)) { CONS_Printf(M_GetText("%s passed authentication.\n"), player_names[playernum]); COM_BufInsertText(va("promote %d\n", playernum)); // do this immediately @@ -3710,9 +3710,9 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; #define NUMJOINCHALLENGES 32 -static UINT8 joinpassmd5[17]; +static UINT8 joinpassmd5[MD5_LEN+1]; boolean joinpasswordset = false; -static UINT8 joinpasschallenges[NUMJOINCHALLENGES][17]; +static UINT8 joinpasschallenges[NUMJOINCHALLENGES][MD5_LEN+1]; static tic_t joinpasschallengeson[NUMJOINCHALLENGES]; boolean D_IsJoinPasswordOn(void) @@ -3722,21 +3722,21 @@ boolean D_IsJoinPasswordOn(void) static inline void GetChallengeAnswer(UINT8 *question, UINT8 *passwordmd5, UINT8 *answer) { - D_MD5PasswordPass(question, 16, (char *) passwordmd5, answer); + D_MD5PasswordPass(question, MD5_LEN, (char *) passwordmd5, answer); } void D_ComputeChallengeAnswer(UINT8 *question, const char *pw, UINT8 *answer) { - static UINT8 passwordmd5[17]; + static UINT8 passwordmd5[MD5_LEN+1]; - memset(passwordmd5, 0x00, 17); + memset(passwordmd5, 0x00, MD5_LEN+1); D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &passwordmd5); GetChallengeAnswer(question, passwordmd5, answer); } void D_SetJoinPassword(const char *pw) { - memset(joinpassmd5, 0x00, 17); + memset(joinpassmd5, 0x00, MD5_LEN+1); D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &joinpassmd5); joinpasswordset = true; } @@ -3748,11 +3748,11 @@ boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer) num %= NUMJOINCHALLENGES; //@TODO use a constant-time memcmp.... - if (joinpasschallengeson[num] > 0 && memcmp(answer, joinpasschallenges[num], 16) == 0) + if (joinpasschallengeson[num] > 0 && memcmp(answer, joinpasschallenges[num], MD5_LEN) == 0) passed = true; // Wipe and reset the challenge so that it can't be tried against again, as a small measure against brute-force attacks. - memset(joinpasschallenges[num], 0x00, 17); + memset(joinpasschallenges[num], 0x00, MD5_LEN+1); joinpasschallengeson[num] = 0; return passed; @@ -3787,8 +3787,8 @@ void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question) joinpasschallengeson[(*num)] = I_GetTime(); - memset(question, 0x00, 17); - for (i = 0; i < 16; i++) + memset(question, 0x00, MD5_LEN+1); + for (i = 0; i < MD5_LEN; i++) question[i] = M_RandomByte(); // Store the answer in memory. What was the question again? diff --git a/src/md5.h b/src/md5.h index 0fe017f51..eaa85dc19 100644 --- a/src/md5.h +++ b/src/md5.h @@ -22,6 +22,8 @@ # include #endif +#define MD5_LEN 16 + /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but diff --git a/src/w_wad.c b/src/w_wad.c index d1c6d488c..b4ae1e0ab 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1556,7 +1556,6 @@ void *W_CachePatchName(const char *name, INT32 tag) return W_CachePatchNum(num, tag); } #ifndef NOMD5 -#define MD5_LEN 16 /** * Prints an MD5 string into a human-readable textual format. From 60296de106e9afb2684a7e928af49fcee9dbbb1a Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 16:49:23 -0600 Subject: [PATCH 47/81] More... --- src/d_clisrv.c | 10 +++++----- src/d_clisrv.h | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6ff024cd2..6d139114d 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1139,9 +1139,9 @@ static cl_mode_t cl_mode = CL_SEARCHING; static boolean cl_needsdownload = false; static UINT8 cl_challengenum = 0; -static UINT8 cl_challengequestion[17]; +static UINT8 cl_challengequestion[MD5_LEN+1]; static char cl_challengepassword[65]; -static UINT8 cl_challengeanswer[17]; +static UINT8 cl_challengeanswer[MD5_LEN+1]; static UINT8 cl_challengeattempted = 0; // Player name send/load @@ -1322,7 +1322,7 @@ static boolean CL_SendJoin(void) netbuffer->u.clientcfg.subversion = SUBVERSION; netbuffer->u.clientcfg.needsdownload = cl_needsdownload; netbuffer->u.clientcfg.challengenum = cl_challengenum; - memcpy(netbuffer->u.clientcfg.challengeanswer, cl_challengeanswer, 16); + memcpy(netbuffer->u.clientcfg.challengeanswer, cl_challengeanswer, MD5_LEN); return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak)); } @@ -3267,8 +3267,8 @@ void D_ClientServerInit(void) gametic = 0; localgametic = 0; - memset(cl_challengequestion, 0x00, 17); - memset(cl_challengeanswer, 0x00, 17); + memset(cl_challengequestion, 0x00, MD5_LEN+1); + memset(cl_challengeanswer, 0x00, MD5_LEN+1); // do not send anything before the real begin SV_StopServer(); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index d979fb287..f3a9011eb 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -19,6 +19,8 @@ #include "tables.h" #include "d_player.h" +#include "md5.h" + // Network play related stuff. // There is a data struct that stores network // communication related stuff, and another From acf1827d9e6ba424445e7fb3e010a1654561fa9c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 16:55:18 -0600 Subject: [PATCH 48/81] Handle capslock in just one place...? --- src/console.c | 10 ---------- src/d_main.c | 2 ++ src/hu_stuff.c | 10 ---------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/console.c b/src/console.c index a10d73e7f..2b3ee0e22 100644 --- a/src/console.c +++ b/src/console.c @@ -1084,16 +1084,6 @@ boolean CON_Responder(event_t *ev) else if (key == KEY_KPADSLASH) key = '/'; - // capslock - if (key == KEY_CAPSLOCK) // it's a toggle. - { - if (capslock) - capslock = false; - else - capslock = true; - return true; - } - // same capslock code as hu_stuff.c's HU_responder. Check there for details. if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z')) { diff --git a/src/d_main.c b/src/d_main.c index 92c1e6aed..07cfdfb2a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -203,6 +203,8 @@ static inline void D_ModifierKeyResponder(event_t *ev) case KEY_RCTRL: ctrldown |= 0x2; return; case KEY_LALT: altdown |= 0x1; return; case KEY_RALT: altdown |= 0x2; return; + case KEY_CAPSLOCK: capslock = !capslock; return; + default: return; } else if (ev->type == ev_keyup) switch (ev->data1) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 94cca970b..bd8f7fd9f 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1159,16 +1159,6 @@ boolean HU_Responder(event_t *ev) c = (INT32)ev->data1; - // capslock (now handled outside of chat on so that it works everytime......) - if (c && c == KEY_CAPSLOCK) // it's a toggle. - { - if (capslock) - capslock = false; - else - capslock = true; - return true; - } - #ifndef NONET if (!chat_on) { From c31cc7cae502be7ad7eda8d72ca104d3e3f371cf Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 17:03:52 -0600 Subject: [PATCH 49/81] Make password toggle only affect password fields --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 881b6682a..f92b0e055 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2691,7 +2691,7 @@ boolean M_Responder(event_t *ev) { if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING || (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) { - if (ch == KEY_TAB) + if (ch == KEY_TAB && (currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_PASSWORD) ((consvar_t *)currentMenu->menuitems[itemOn].itemaction)->value ^= 1; if (shiftdown && ch >= 32 && ch <= 127) From bc647657f4f1df03bf3a33d5c8cf1a4ab5ac719c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 17:06:44 -0600 Subject: [PATCH 50/81] Fix password auto-hiding if you type into it --- src/command.c | 3 ++- src/command.h | 3 ++- src/d_clisrv.c | 6 ------ src/d_netcmd.c | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index bb2ea86e6..a5d45bc1e 100644 --- a/src/command.c +++ b/src/command.c @@ -1254,7 +1254,8 @@ found: var->string = var->zstring = Z_StrDup(valstr); - if (override) + if (var->flags & CV_PASSWORD); // Don't change value for password field + else if (override) var->value = overrideval; else if (var->flags & CV_FLOAT) { diff --git a/src/command.h b/src/command.h index 82dfaf8aa..f9d177e2e 100644 --- a/src/command.h +++ b/src/command.h @@ -95,7 +95,8 @@ typedef enum CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console // can only be set when we have the pointer to it // used on menus - CV_CHEAT = 2048 // Don't let this be used in multiplayer unless cheats are on. + CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on. + CV_PASSWORD = 4096 // Password field } cvflags_t; typedef struct CV_PossibleValue_s diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6d139114d..087886133 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2173,12 +2173,6 @@ boolean CL_Responder(event_t *ev) ch = (INT32)ev->data1; - if (ch == KEY_CAPSLOCK) // it's a toggle. - { - capslock = !capslock; - return true; - } - // Only ESC and non-keyboard keys abort connection if (ch == KEY_ESCAPE || ch >= KEY_MOUSE1) { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index abc319498..1f75a3bfe 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3707,7 +3707,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) } // Join password stuff -consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP|CV_PASSWORD, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; #define NUMJOINCHALLENGES 32 static UINT8 joinpassmd5[MD5_LEN+1]; From ef603143c93a3338700333f3f7c17459753524ab Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Sat, 9 Mar 2019 18:09:38 -0500 Subject: [PATCH 51/81] fix VCHELP --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index cca1e9049..351328ec9 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5052,8 +5052,8 @@ static inline void PingUpdate(void) pingtimeout[i]++; if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { - pingtimeout[i] = 0; XBOXSTATIC char buf[2]; + pingtimeout[i] = 0; buf[0] = (char)i; buf[1] = KICK_MSG_PING_HIGH; From 8502a5823f0ea2dfb42de8299e4bad97e988700d Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Sat, 9 Mar 2019 18:17:38 -0500 Subject: [PATCH 52/81] c is only for chat_in --- src/hu_stuff.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index bd8f7fd9f..11a989f52 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1130,8 +1130,6 @@ static INT16 typelines = 1; // number of drawfill lines we need when drawing the // boolean HU_Responder(event_t *ev) { - INT32 c=0; - if (ev->type != ev_keydown) return false; @@ -1157,8 +1155,6 @@ boolean HU_Responder(event_t *ev) return false; } - c = (INT32)ev->data1; - #ifndef NONET if (!chat_on) { @@ -1186,6 +1182,7 @@ boolean HU_Responder(event_t *ev) } else // if chat_on { + INT32 c = (INT32)ev->data1; // Ignore modifier keys // Note that we do this here so users can still set @@ -1201,8 +1198,6 @@ boolean HU_Responder(event_t *ev) && ev->data1 != gamecontrol[gc_talkkey][1])) return false; - c = (INT32)ev->data1; - // I know this looks very messy but this works. If it ain't broke, don't fix it! // shift LETTERS to uppercase if we have capslock or are holding shift if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) From 26b7efddb4a113934f06bb8f5204f0590cbb0ba6 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 17:24:20 -0600 Subject: [PATCH 53/81] Make P_NukeEnemies (including K_DoThunderShield) scale by mapscale --- src/p_user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 7350b9214..5777f6e76 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7654,12 +7654,14 @@ static void P_NukeAllPlayers(player_t *player) // void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) { - const fixed_t ns = 60 << FRACBITS; + const fixed_t ns = 60 * mapobjectscale; mobj_t *mo; angle_t fa; thinker_t *think; INT32 i; + radius = FixedMul(radius, mapobjectscale); + for (i = 0; i < 16; i++) { fa = (i*(FINEANGLES/16)); From 1743d35fc2fc3f743c2ab365952c338033785b62 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 17:28:05 -0600 Subject: [PATCH 54/81] Disable stacking thunder shields --- src/p_inter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index 7da581a5f..da652120d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -141,6 +141,9 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon) || (weapon != 3 && player->kartstuff[k_itemamount]) || player->kartstuff[k_itemheld]) return false; + + if (weapon == 3 && player->kartstuff[k_itemtype] = KITEM_THUNDERSHIELD) + return false; // No stacking thunder shields! } } From d386febf56f8b1e7bda3828b8cb425e823433521 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 9 Mar 2019 19:41:56 -0500 Subject: [PATCH 55/81] TravisCI: add option for GCC 8.1 --- .travis.yml | 8 ++++++-- src/Makefile.cfg | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1131bff3a..50dbab791 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ matrix: - p7zip-full - gcc-4.4 compiler: gcc-4.4 + env: GCC44=1 #gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7 - os: linux addons: @@ -27,6 +28,7 @@ matrix: - p7zip-full - gcc-4.6 compiler: gcc-4.6 + env: GCC46=1 #gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4 - os: linux addons: @@ -42,6 +44,7 @@ matrix: #gcc-4.7 - os: linux compiler: gcc + env: GCC48=1 #gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 - os: linux addons: @@ -56,6 +59,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 + env: GCC48=1 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - os: linux addons: @@ -70,7 +74,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" GCC72=1 #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -85,7 +89,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow" GCC81=1 #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 236d7ae2f..a0398154a 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -7,6 +7,10 @@ # and other things # +ifdef GCC81 +GCC80=1 +endif + ifdef GCC80 GCC72=1 endif From a22c9a999ecd0f64ca004df28ad76a3f053d485b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 9 Mar 2019 20:16:54 -0500 Subject: [PATCH 56/81] TravisCI: remove WFLAGS --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50dbab791..77fd82c80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ matrix: - p7zip-full - gcc-4.7 compiler: gcc-4.7 + env: GCC47=1 #gcc-4.7 - os: linux compiler: gcc @@ -74,7 +75,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" GCC72=1 + env: GCC72=1 #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -89,7 +90,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow" GCC81=1 + env: GCC81=1 #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang From a2c1b63864d0ff58e1e055c0dbaad1258981f99e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 9 Mar 2019 20:35:23 -0500 Subject: [PATCH 57/81] partly Revert "TravisCI: remove WFLAGS" This reverts commit a22c9a999ecd0f64ca004df28ad76a3f053d485b. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77fd82c80..4bfc58860 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,7 +75,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: GCC72=1 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" GCC72=1 #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -90,7 +90,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: GCC81=1 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow" GCC81=1 #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang From 00e5b59fe28eee039008c31a1cc909e3d3764ce1 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 20:23:49 -0600 Subject: [PATCH 58/81] bah --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index da652120d..5aa6ef173 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -142,7 +142,7 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon) || player->kartstuff[k_itemheld]) return false; - if (weapon == 3 && player->kartstuff[k_itemtype] = KITEM_THUNDERSHIELD) + if (weapon == 3 && player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD) return false; // No stacking thunder shields! } } From 28d101ac1ae655970f1416b03cc919de0db02f2b Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Sat, 9 Mar 2019 21:57:59 -0500 Subject: [PATCH 59/81] Please do not go past the doomdata_t space --- src/d_clisrv.c | 2 +- src/d_clisrv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 351328ec9..2e90d2ef7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5077,7 +5077,7 @@ static inline void PingUpdate(void) } // send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked. - netbuffer->u.pingtable[i++] = cv_maxping.value; + netbuffer->u.pingtable[MAXPLAYERS] = cv_maxping.value; //send out our ping packets for (i = 0; i < MAXNETNODES; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 04569198f..7f176bd94 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -453,7 +453,7 @@ typedef struct plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes (I'd say 36~38) plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes (welp they ARE) #ifdef NEWPING - UINT32 pingtable[MAXPLAYERS]; // 128 bytes + UINT32 pingtable[MAXPLAYERS+1]; // 128 bytes #endif } u; // This is needed to pack diff packet types data together } ATTRPACK doomdata_t; From 12750e06e35dff37c89767deb301ae033f6593f8 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 21:08:29 -0600 Subject: [PATCH 60/81] Fix improperly-resolved merge conflict --- src/d_clisrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index da5dd3e32..8e2a42de8 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5099,7 +5099,6 @@ static inline void PingUpdate(void) if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { XBOXSTATIC char buf[2]; - pingtimeout[i] = 0; pingtimeout[i] = 0; From fe651ae79b6f1575d99adc700bf01f73da21ffc1 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 22:17:16 -0600 Subject: [PATCH 61/81] Revert "Move HandleConnect to the same place as other packets" This reverts commit 055d73c1e7d1bcd816018f91ced969ebea530533. --- src/d_clisrv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 087886133..6734b5448 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3944,10 +3944,6 @@ static void HandlePacketFromAwayNode(SINT8 node) Net_CloseConnection(node); break; - case PT_CLIENTJOIN: - if (server) - HandleConnect(node); - break; case PT_JOINCHALLENGE: if (server && serverrunning) { // But wait I thought I'm the server? @@ -4663,6 +4659,12 @@ FILESTAMP while (HGetPacket()) { node = (SINT8)doomcom->remotenode; + + if (netbuffer->packettype == PT_CLIENTJOIN && server) + { + HandleConnect(node); + continue; + } if (node == servernode && client && cl_mode != CL_SEARCHING) { if (netbuffer->packettype == PT_SERVERSHUTDOWN) From 19e515d439585d8ef787af06ff3ee578a573ee37 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 9 Mar 2019 23:18:55 -0600 Subject: [PATCH 62/81] Kill all skin flags but SF_HIRES --- src/d_player.h | 7 +- src/dehacked.c | 5 - src/p_inter.c | 60 ------------ src/p_mobj.c | 97 +------------------ src/p_user.c | 252 ------------------------------------------------- src/r_things.c | 2 +- 6 files changed, 3 insertions(+), 420 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index abd7d1669..959b4ed3f 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -32,12 +32,7 @@ // Extra abilities/settings for skins (combinable stuff) typedef enum { - SF_SUPER = 1, // Can turn super in singleplayer/co-op mode. - SF_SUPERANIMS = 1<<1, // If super, use the super sonic animations - SF_SUPERSPIN = 1<<2, // Should spin frames be played while super? - SF_HIRES = 1<<3, // Draw the sprite 2x as small? - SF_NOSKID = 1<<4, // No skid particles etc - SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust + SF_HIRES = 1, // Draw the sprite 2x as small? } skinflags_t; //Primary and secondary skin abilities diff --git a/src/dehacked.c b/src/dehacked.c index 34cd86b67..64a6242fc 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8608,12 +8608,7 @@ struct { {"RW_RAIL",RW_RAIL}, // Character flags (skinflags_t) - {"SF_SUPER",SF_SUPER}, - {"SF_SUPERANIMS",SF_SUPERANIMS}, - {"SF_SUPERSPIN",SF_SUPERSPIN}, {"SF_HIRES",SF_HIRES}, - {"SF_NOSKID",SF_NOSKID}, - {"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST}, // Character abilities! // Primary diff --git a/src/p_inter.c b/src/p_inter.c index dd27858fc..35be83adf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2952,66 +2952,6 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) } } -/* -static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) // SRB2kart - unused. -{ - fixed_t fallbackspeed; - angle_t ang; - - P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - - if (player->mo->eflags & MFE_VERTICALFLIP) - player->mo->z--; - else - player->mo->z++; - - if (player->mo->eflags & MFE_UNDERWATER) - P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); - else - P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); - - ang = R_PointToAngle2(inflictor->x, inflictor->y, player->mo->x, player->mo->y); - - // explosion and rail rings send you farther back, making it more difficult - // to recover - if (inflictor->flags2 & MF2_SCATTER && source) - { - fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); - - dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; - - if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) - dist = FixedMul(4*FRACUNIT, inflictor->scale); - - fallbackspeed = dist; - } - else if (inflictor->flags2 & MF2_EXPLOSION) - { - if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(28*FRACUNIT, inflictor->scale); // 7x - else - fallbackspeed = FixedMul(20*FRACUNIT, inflictor->scale); // 5x - } - else if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(16*FRACUNIT, inflictor->scale); // 4x - else - fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force - - P_InstaThrust(player->mo, ang, fallbackspeed); - - // SRB2kart - This shouldn't be reachable, but this frame is invalid. - //if (player->charflags & SF_SUPERANIMS) - // P_SetPlayerMobjState(player->mo, S_PLAY_SUPERHIT); - //else - P_SetPlayerMobjState(player->mo, player->mo->info->painstate); - - P_ResetPlayer(player); - - if (player->timeshit != UINT8_MAX) - ++player->timeshit; -} -*/ - void P_RemoveShield(player_t *player) { if (player->powers[pw_shield] & SH_FORCE) diff --git a/src/p_mobj.c b/src/p_mobj.c index c070560fd..0130924c0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -167,58 +167,8 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) I_Error("P_SetPlayerMobjState used for non-player mobj. Use P_SetMobjState instead!\n(Mobj type: %d, State: %d)", mobj->type, state); #endif - // Catch state changes for Super Sonic - /* // SRB2kart - don't need - if (player->powers[pw_super] && (player->charflags & SF_SUPERANIMS)) - { - switch (state) - { - case S_PLAY_STND: - case S_PLAY_TAP1: - case S_PLAY_TAP2: - case S_PLAY_GASP: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERSTAND); - return true; - case S_PLAY_FALL1: - case S_PLAY_SPRING: - case S_PLAY_RUN1: - case S_PLAY_RUN2: - case S_PLAY_RUN3: - case S_PLAY_RUN4: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK1); - return true; - case S_PLAY_FALL2: - case S_PLAY_RUN5: - case S_PLAY_RUN6: - case S_PLAY_RUN7: - case S_PLAY_RUN8: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK2); - return true; - case S_PLAY_SPD1: - case S_PLAY_SPD2: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY1); - return true; - case S_PLAY_SPD3: - case S_PLAY_SPD4: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY2); - return true; - case S_PLAY_TEETER1: - case S_PLAY_TEETER2: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERTEETER); - return true; - case S_PLAY_ATK1: - case S_PLAY_ATK2: - case S_PLAY_ATK3: - case S_PLAY_ATK4: - if (!(player->charflags & SF_SUPERSPIN)) - return true; - break; - default: - break; - } - } // You were in pain state after taking a hit, and you're moving out of pain state now? - else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate) + if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate) { // Start flashing, since you've landed. player->powers[pw_flashing] = K_GetKartFlashing(player)-1; @@ -260,51 +210,6 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) st = &states[state]; mobj->state = st; mobj->tics = st->tics; - - // Adjust the player's animation speed to match their velocity. - if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST)) - { - fixed_t speed = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor)); // fixed_t speed = FixedDiv(player->speed, mobj->scale); - if (player->panim == PA_ROLL) - { - if (speed > 16<tics = 1; - else - mobj->tics = 2; - } - else if (player->panim == PA_FALL) - { - speed = FixedDiv(abs(mobj->momz), mobj->scale); - if (speed < 10<tics = 4; - else if (speed < 20<tics = 3; - else if (speed < 30<tics = 2; - else - mobj->tics = 1; - } - else if (P_IsObjectOnGround(mobj) || player->powers[pw_super]) // Only if on the ground or superflying. - { - if (player->panim == PA_WALK) - { - if (speed > 12<tics = 2; - else if (speed > 6<tics = 3; - else - mobj->tics = 4; - } - else if (player->panim == PA_RUN) - { - if (speed > 52<tics = 1; - else - mobj->tics = 2; - } - } - } - mobj->sprite = st->sprite; mobj->frame = st->frame; mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set diff --git a/src/p_user.c b/src/p_user.c index 7350b9214..9dd7dc61b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3634,165 +3634,6 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) // SRB2kart - unused. } */ -#if 0 -// -// P_DoSuperStuff() -// -// Handle related superform functionality. -// -static void P_DoSuperStuff(player_t *player) -{ - mobj_t *spark; - ticcmd_t *cmd = &player->cmd; - //if (player->mo->state >= &states[S_PLAY_SUPERTRANS1] && player->mo->state <= &states[S_PLAY_SUPERTRANS9]) - // return; // don't do anything right now, we're in the middle of transforming! - - if (player->pflags & PF_NIGHTSMODE) - return; // NiGHTS Super doesn't mix with normal super - - // Does player have all emeralds? If so, flag the "Ready For Super!" - /*if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50) - player->pflags |= PF_SUPERREADY; - else - player->pflags &= ~PF_SUPERREADY;*/ - - if (player->powers[pw_super]) - { - // If you're super and not Sonic, de-superize! - if (!((ALL7EMERALDS(emeralds)) && (player->charflags & SF_SUPER)) && !(ALL7EMERALDS(player->powers[pw_emeralds]))) - { - player->powers[pw_super] = 0; - P_SetPlayerMobjState(player->mo, S_KART_STND1); - P_RestoreMusic(player); - P_SpawnShieldOrb(player); - - // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - if (gametype != GT_COOP) - { - HU_SetCEchoFlags(0); - HU_SetCEchoDuration(5); - HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players])); - } - return; - } - - // Deplete one ring every second while super - if ((leveltime % TICRATE == 0) && !(player->exiting)) - { - player->health--; - player->mo->health--; - } - - // future todo: a skin option for this, and possibly more colors - switch (player->skin) - { - case 1: /* Tails */ player->mo->color = SKINCOLOR_TSUPER1; break; - case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; - default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; - } - player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); - - if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) - && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) - { - spark = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SUPERSPARK); - spark->destscale = player->mo->scale; - P_SetScale(spark, player->mo->scale); - } - - G_GhostAddColor(GHC_SUPER); - - // Ran out of rings while super! - if (player->health <= 1 || player->exiting) - { - player->powers[pw_emeralds] = 0; // lost the power stones - P_SpawnGhostMobj(player->mo); - - player->powers[pw_super] = 0; - - // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - if (gametype != GT_COOP) - player->powers[pw_flashing] = K_GetKartFlashing(player)-1; - -/* - if (player->mo->health > 0) - { - if ((player->pflags & PF_JUMPED) || (player->pflags & PF_SPINNING)) - P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); - else if (player->panim == PA_RUN) - P_SetPlayerMobjState(player->mo, S_PLAY_SPD1); - else if (player->panim == PA_WALK) - P_SetPlayerMobjState(player->mo, S_PLAY_RUN1); - else - P_SetPlayerMobjState(player->mo, S_PLAY_STND); - - if (!player->exiting) - { - player->health = 1; - player->mo->health = 1; - } - } -*/ - - // Inform the netgame that the champion has fallen in the heat of battle. - if (gametype != GT_COOP) - { - S_StartSound(NULL, sfx_s3k66); //let all players hear it. - HU_SetCEchoFlags(0); - HU_SetCEchoDuration(5); - HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players])); - } - - // Resume normal music if you're the console player - P_RestoreMusic(player); - - // If you had a shield, restore its visual significance. - P_SpawnShieldOrb(player); - } - } -} -#endif - -// -// P_SuperReady -// -// Returns true if player is ready to turn super, duh -// -/*boolean P_SuperReady(player_t *player) -{ - if ((player->pflags & PF_SUPERREADY) && !player->powers[pw_super] && !player->powers[pw_tailsfly] - && !(player->powers[pw_shield] & SH_NOSTACK) - && !player->powers[pw_invulnerability] - && !(maptol & TOL_NIGHTS) // don't turn 'regular super' in nights levels - && player->pflags & PF_JUMPED - && ((player->charflags & SF_SUPER) || ALL7EMERALDS(player->powers[pw_emeralds]))) - return true; - - return false; -}*/ - // // P_DoJump // @@ -6382,99 +6223,6 @@ void P_ElementalFireTrail(player_t *player) } } -/*static void P_SkidStuff(player_t *player) -{ - fixed_t pmx = player->rmomx + player->cmomx; - fixed_t pmy = player->rmomy + player->cmomy; - - // Knuckles glides into the dirt. - // SRB2kart - don't need - if (player->pflags & PF_GLIDING && player->skidtime) - { - // Fell off a ledge... - if (!onground) - { - player->skidtime = 0; - player->pflags &= ~(PF_GLIDING|PF_JUMPED); - P_SetPlayerMobjState(player->mo, S_PLAY_FALL1); - } - // Get up and brush yourself off, idiot. - else if (player->glidetime > 15) - { - P_ResetPlayer(player); - P_SetPlayerMobjState(player->mo, S_PLAY_STND); - player->mo->momx = player->cmomx; - player->mo->momy = player->cmomy; - } - // Didn't stop yet? Skid FOREVER! - else if (player->skidtime == 1) - player->skidtime = 3*TICRATE+1; - // Spawn a particle every 3 tics. - else if (!(player->skidtime % 3)) - { - mobj_t *particle = P_SpawnMobj(player->mo->x + P_RandomRange(-player->mo->radius, player->mo->radius), player->mo->y + P_RandomRange(-player->mo->radius, player->mo->radius), - player->mo->z + (player->mo->eflags & MFE_VERTICALFLIP ? player->mo->height - mobjinfo[MT_PARTICLE].height : 0), - MT_PARTICLE); - particle->tics = 10; - - particle->eflags |= player->mo->eflags & MFE_VERTICALFLIP; - P_SetScale(particle, player->mo->scale >> 2); - particle->destscale = player->mo->scale << 2; - particle->scalespeed = FixedMul(particle->scalespeed, player->mo->scale); // scale the scaling speed! - P_SetObjectMomZ(particle, FRACUNIT, false); - S_StartSound(player->mo, sfx_s3k7e); // the proper "Knuckles eats dirt" sfx. - } - } - // Skidding! - elseif (onground && !(player->mo->eflags & MFE_GOOWATER) && !(player->pflags & (PF_JUMPED|PF_SPINNING|PF_SLIDING)) && !(player->charflags & SF_NOSKID)) - { - if (player->skidtime) - { - // Spawn a particle every 3 tics. - if (!(player->skidtime % 3)) - { - mobj_t *particle = P_SpawnMobj(player->mo->x, player->mo->y, - player->mo->z + (player->mo->eflags & MFE_VERTICALFLIP ? player->mo->height - mobjinfo[MT_PARTICLE].height : 0), - MT_PARTICLE); - particle->tics = 10; - - particle->eflags |= player->mo->eflags & MFE_VERTICALFLIP; - P_SetScale(particle, player->mo->scale >> 2); - particle->destscale = player->mo->scale << 2; - particle->scalespeed = FixedMul(particle->scalespeed, player->mo->scale); // scale the scaling speed! - P_SetObjectMomZ(particle, FRACUNIT, false); - } - } - else if (P_AproxDistance(pmx, pmy) >= FixedMul(player->runspeed/2, player->mo->scale) // if you were moving faster than half your run speed last frame - && (player->mo->momx != pmx || player->mo->momy != pmy) // and you are moving differently this frame - && P_GetPlayerControlDirection(player) == 2) // and your controls are pointing in the opposite direction to your movement - { // check for skidding - angle_t mang = R_PointToAngle2(0,0,pmx,pmy); // movement angle - angle_t pang = R_PointToAngle2(pmx,pmy,player->mo->momx,player->mo->momy); // push angle - angle_t dang = mang - pang; // delta angle - - if (dang > ANGLE_180) // Make delta angle always positive, invert it if it's negative. - dang = InvAngle(dang); - - // If your push angle is more than this close to a full 180 degrees, trigger a skid. - if (dang > ANGLE_157h) - { - player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; //player->skidtime = TICRATE/2; - S_StartSound(player->mo, sfx_skid); - if (player->panim != PA_WALK) - P_SetPlayerMobjState(player->mo, S_KART_WALK2); // SRB2kart - was S_PLAY_RUN4 - player->mo->tics = player->skidtime; - } - } - } - else { - if (player->skidtime) { - player->skidtime = 0; - S_StopSound(player->mo); - } - } -}*/ - // // P_MovePlayer static void P_MovePlayer(player_t *player) diff --git a/src/r_things.c b/src/r_things.c index 822643947..a40830ac5 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2570,7 +2570,7 @@ void R_InitSkins(void) #ifdef SKINVALUES skin_cons_t[0].strvalue = skins[0].name; #endif - skin->flags = SF_SUPER|SF_SUPERANIMS|SF_SUPERSPIN; + skin->flags = 0; strcpy(skin->realname, "Sonic"); strcpy(skin->hudname, "SONIC"); From 28e4cfdb6da81ee5d285f4dcec7900dc863745d8 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 23:36:11 -0600 Subject: [PATCH 63/81] Properly close and reopen the client connection for password challenges --- src/d_clisrv.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6734b5448..b05babd64 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1909,7 +1909,7 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room) /** Called by CL_ServerConnectionTicker * * \param viams ??? - * \param asksent ??? + * \param asksent The last time we asked the server to join. We re-ask every second in case our request got lost in transmit. * \return False if the connection was aborted * \sa CL_ServerConnectionTicker * \sa CL_ConnectToServer @@ -2037,7 +2037,7 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) * \param viams ??? * \param tmpsave The name of the gamestate file??? * \param oldtic Used for knowing when to poll events and redraw - * \param asksent ??? + * \param asksent The last time we asked the server to join. We re-ask every second in case our request got lost in transmit. * \return False if the connection was aborted * \sa CL_ServerConnectionSearchTicker * \sa CL_ConnectToServer @@ -2109,6 +2109,9 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic #endif case CL_CHALLENGE: + (*asksent) = I_GetTime() - NEWTICRATE + 2; // This is SUPPOSED to remove the delay from sending the password but it doesn't work... + break; + case CL_WAITJOINRESPONSE: case CL_WAITDOWNLOADFILESRESPONSE: case CL_CONNECTED: @@ -2226,10 +2229,26 @@ boolean CL_Responder(event_t *ev) } else if (ch == KEY_ENTER) { - // Done? - D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_mode = cl_needsdownload ? CL_ASKDOWNLOADFILES : CL_ASKJOIN; - cl_challengeattempted = 1; + // Done? Try to reconnect to the server... + if (!netgame && I_NetOpenSocket) + { + MSCloseUDPSocket(); // Tidy up before wiping the slate. + if (I_NetOpenSocket()) + { + netgame = true; + multiplayer = true; + +#ifndef NONET + SL_ClearServerList(servernode); +#endif + cl_mode = CL_SEARCHING; + + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_challengeattempted = 1; + } + } + else + I_Error("haha that ain't it"); } return true; @@ -3956,6 +3975,8 @@ static void HandlePacketFromAwayNode(SINT8 node) cl_challengenum = netbuffer->u.joinchallenge.challengenum; memcpy(cl_challengequestion, netbuffer->u.joinchallenge.question, 16); + D_CloseConnection(); // Don't need to stay connected while challenging + cl_mode = CL_CHALLENGE; if (cl_challengeattempted == 2) From 9f48006254832a6a02519d03ceb4b39398671905 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 23:56:13 -0600 Subject: [PATCH 64/81] Try a partial disconnect instead --- src/d_clisrv.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index b05babd64..170c96450 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2109,7 +2109,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic #endif case CL_CHALLENGE: - (*asksent) = I_GetTime() - NEWTICRATE + 2; // This is SUPPOSED to remove the delay from sending the password but it doesn't work... + (*asksent) = I_GetTime() - NEWTICRATE; // This is SUPPOSED to remove the delay from sending the password but it doesn't work... break; case CL_WAITJOINRESPONSE: @@ -2229,26 +2229,16 @@ boolean CL_Responder(event_t *ev) } else if (ch == KEY_ENTER) { - // Done? Try to reconnect to the server... - if (!netgame && I_NetOpenSocket) - { - MSCloseUDPSocket(); // Tidy up before wiping the slate. - if (I_NetOpenSocket()) - { - netgame = true; - multiplayer = true; + netgame = true; + multiplayer = true; #ifndef NONET - SL_ClearServerList(servernode); + SL_ClearServerList(servernode); #endif - cl_mode = CL_SEARCHING; + cl_mode = CL_SEARCHING; - D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_challengeattempted = 1; - } - } - else - I_Error("haha that ain't it"); + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_challengeattempted = 1; } return true; @@ -3975,7 +3965,7 @@ static void HandlePacketFromAwayNode(SINT8 node) cl_challengenum = netbuffer->u.joinchallenge.challengenum; memcpy(cl_challengequestion, netbuffer->u.joinchallenge.question, 16); - D_CloseConnection(); // Don't need to stay connected while challenging + Net_CloseConnection(node|FORCECLOSE); // Don't need to stay connected while challenging cl_mode = CL_CHALLENGE; From f8a75cb4fc9316cc6d7b4f5d77ec6d01edb7555d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 12:50:24 -0500 Subject: [PATCH 65/81] Improve stability when joining netgames maybe --- src/d_clisrv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 170c96450..1da11e71e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2084,14 +2084,20 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic CL_PrepareDownloadSaveGame(tmpsave); #endif if (CL_SendJoin()) + { + *asksent = I_GetTime(); cl_mode = CL_WAITJOINRESPONSE; + } break; case CL_ASKDOWNLOADFILES: cl_needsdownload = true; if (CL_SendJoin()) + { + *asksent = I_GetTime(); cl_mode = CL_WAITDOWNLOADFILESRESPONSE; + } break; @@ -2114,6 +2120,13 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic case CL_WAITJOINRESPONSE: case CL_WAITDOWNLOADFILESRESPONSE: + if (*asksent + NEWTICRATE < I_GetTime() && CL_SendJoin()) + { + *asksent = I_GetTime(); + } + + break; + case CL_CONNECTED: default: break; From 99cf366e6e203eaa71ed5a426e9cb492ac4c06a3 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 15:48:11 -0500 Subject: [PATCH 66/81] Skip password check if node is already in-game? idk --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1da11e71e..ca9e20847 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3775,7 +3775,7 @@ static void HandleConnect(SINT8 node) boolean newnode = false; #endif - if (node != servernode && D_IsJoinPasswordOn()) + if (node != servernode && !nodeingame[node] && D_IsJoinPasswordOn()) { // Ensure node sent the correct password challenge boolean passed = false; From 0c85666080842785719c7b8dbb2eb6c6629beb7e Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 15:48:55 -0500 Subject: [PATCH 67/81] Fix dehacked color list being wrong --- src/dehacked.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index b0d0df96c..97cf243f1 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8147,8 +8147,8 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "GREY", // SKINCOLOR_GREY "NICKEL", // SKINCOLOR_NICKEL "BLACK", // SKINCOLOR_BLACK - "FAIRY", // SKINCOLOR_FAIRY "POPCORN", // SKINCOLOR_POPCORN + "FAIRY", // SKINCOLOR_FAIRY "SEPIA", // SKINCOLOR_SEPIA "BEIGE", // SKINCOLOR_BEIGE "BROWN", // SKINCOLOR_BROWN @@ -8226,12 +8226,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "PURPLE", // SKINCOLOR_PURPLE "FUCHSIA", // SKINCOLOR_FUCHSIA "TOXIC", // SKINCOLOR_TOXIC + "MAUVE", // SKINCOLOR_MAUVE "LAVENDER", // SKINCOLOR_LAVENDER "BYZANTIUM", // SKINCOLOR_BYZANTIUM - "MAUVE", // SKINCOLOR_MAUVE "POMEGRANATE", // SKINCOLOR_POMEGRANATE "LILAC", // SKINCOLOR_LILAC + + + + // Special super colors // Super Sonic Yellow "SUPER1", // SKINCOLOR_SUPER1 @@ -8239,48 +8243,56 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SUPER3", // SKINCOLOR_SUPER3, "SUPER4", // SKINCOLOR_SUPER4, "SUPER5", // SKINCOLOR_SUPER5, + // Super Tails Orange "TSUPER1", // SKINCOLOR_TSUPER1, "TSUPER2", // SKINCOLOR_TSUPER2, "TSUPER3", // SKINCOLOR_TSUPER3, "TSUPER4", // SKINCOLOR_TSUPER4, "TSUPER5", // SKINCOLOR_TSUPER5, + // Super Knuckles Red "KSUPER1", // SKINCOLOR_KSUPER1, "KSUPER2", // SKINCOLOR_KSUPER2, "KSUPER3", // SKINCOLOR_KSUPER3, "KSUPER4", // SKINCOLOR_KSUPER4, "KSUPER5", // SKINCOLOR_KSUPER5, + // Hyper Sonic Pink "PSUPER1", // SKINCOLOR_PSUPER1, "PSUPER2", // SKINCOLOR_PSUPER2, "PSUPER3", // SKINCOLOR_PSUPER3, "PSUPER4", // SKINCOLOR_PSUPER4, "PSUPER5", // SKINCOLOR_PSUPER5, + // Hyper Sonic Blue "BSUPER1", // SKINCOLOR_BSUPER1, "BSUPER2", // SKINCOLOR_BSUPER2, "BSUPER3", // SKINCOLOR_BSUPER3, "BSUPER4", // SKINCOLOR_BSUPER4, - "BSUPER5" // SKINCOLOR_BSUPER5, + "BSUPER5", // SKINCOLOR_BSUPER5, + // Aqua Super "ASUPER1", // SKINCOLOR_ASUPER1, "ASUPER2", // SKINCOLOR_ASUPER2, "ASUPER3", // SKINCOLOR_ASUPER3, "ASUPER4", // SKINCOLOR_ASUPER4, "ASUPER5", // SKINCOLOR_ASUPER5, + // Hyper Sonic Green "GSUPER1", // SKINCOLOR_GSUPER1, "GSUPER2", // SKINCOLOR_GSUPER2, "GSUPER3", // SKINCOLOR_GSUPER3, "GSUPER4", // SKINCOLOR_GSUPER4, "GSUPER5", // SKINCOLOR_GSUPER5, + // Hyper Sonic White "WSUPER1", // SKINCOLOR_WSUPER1, "WSUPER2", // SKINCOLOR_WSUPER2, "WSUPER3", // SKINCOLOR_WSUPER3, "WSUPER4", // SKINCOLOR_WSUPER4, "WSUPER5", // SKINCOLOR_WSUPER5, + // Creamy Super (Shadow?) "CSUPER1", // SKINCOLOR_CSUPER1, "CSUPER2", // SKINCOLOR_CSUPER2, From a2f849c49c966399f1e308ea20ba58ff314aaa1b Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 16:06:46 -0500 Subject: [PATCH 68/81] Update packettypenames --- src/d_net.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 530ee6df0..9f7199673 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -821,10 +821,6 @@ static const char *packettypename[NUMPACKETTYPE] = "CLIENTMIS", "CLIENT2CMD", "CLIENT2MIS", - "CLIENT3CMD", - "CLIENT3MIS", - "CLIENT4CMD", - "CLIENT4MIS", "NODEKEEPALIVE", "NODEKEEPALIVEMIS", "SERVERTICS", @@ -841,6 +837,15 @@ static const char *packettypename[NUMPACKETTYPE] = "RESYNCHEND", "RESYNCHGET", + "CLIENT3CMD", + "CLIENT3MIS", + "CLIENT4CMD", + "CLIENT4MIS", + "BASICKEEPALIVE", + + "JOINCHALLENGE", + "DOWNLOADFILESOKAY", + "FILEFRAGMENT", "TEXTCMD", "TEXTCMD2", From 99a934e352dfa9834b9d41a3fdb61fdafd28aac2 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 16:22:03 -0500 Subject: [PATCH 69/81] Properly close the connection on the server's side... --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ca9e20847..be39f7075 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3789,7 +3789,7 @@ static void HandleConnect(SINT8 node) netbuffer->packettype = PT_JOINCHALLENGE; HSendPacket(node, true, 0, sizeof(joinchallenge_pak)); - //Net_CloseConnection(node); + Net_CloseConnection(node); return; } From 1cd8c15e8ccdea4e41ee7c63afec35956825d637 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:00:27 -0500 Subject: [PATCH 70/81] Show notice of a password-protected server on the join screen --- src/d_clisrv.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index be39f7075..4954a762f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1179,6 +1179,8 @@ static void CV_LoadPlayerNames(UINT8 **p) } #ifdef CLIENT_LOADINGSCREEN +static UINT32 SL_SearchServer(INT32 node); + // // CL_DrawConnectionStatus // @@ -1212,12 +1214,28 @@ static inline void CL_DrawConnectionStatus(void) { char asterisks[33]; size_t sl = min(32, strlen(cl_challengepassword)); + UINT32 i; memset(asterisks, '*', sl); memset(asterisks+sl, 0, 33-sl); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); + i = SL_SearchServer(servernode); + + if (i == -1) + { + M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8, 32, 1); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_REDMAP, M_GetText("This server is password protected.")); + } + else + { + M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8-8, 32, 3); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2-8, V_REDMAP, M_GetText("This server,")); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_ALLOWLOWERCASE, serverlist[i].info.servername); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+8, V_REDMAP, M_GetText("is password protected.")); + } + cltext = M_GetText(cl_challengeattempted ? "Incorrect password. Please try again." : "Please enter the server password."); } break; From 7bd8effc6527c48b93819db6498044a1f98a2b21 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:25:55 -0500 Subject: [PATCH 71/81] Draw a padlock on-screen! --- src/d_clisrv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4954a762f..01304f38b 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1220,6 +1220,7 @@ static inline void CL_DrawConnectionStatus(void) memset(asterisks+sl, 0, 33-sl); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); + V_DrawFixedPatch((BASEVIDWIDTH/2) << FRACBITS, (BASEVIDHEIGHT/2) << FRACBITS, FRACUNIT, 0, W_CachePatchName("BSRVLOCK", PU_CACHE), NULL); i = SL_SearchServer(servernode); @@ -1230,10 +1231,10 @@ static inline void CL_DrawConnectionStatus(void) } else { - M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8-8, 32, 3); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2-8, V_REDMAP, M_GetText("This server,")); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_ALLOWLOWERCASE, serverlist[i].info.servername); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+8, V_REDMAP, M_GetText("is password protected.")); + M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8, 32, 3); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_REDMAP, M_GetText("This server,")); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+8, V_ALLOWLOWERCASE, serverlist[i].info.servername); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+16, V_REDMAP, M_GetText("is password protected.")); } cltext = M_GetText(cl_challengeattempted ? "Incorrect password. Please try again." : "Please enter the server password."); @@ -2133,7 +2134,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic #endif case CL_CHALLENGE: - (*asksent) = I_GetTime() - NEWTICRATE; // This is SUPPOSED to remove the delay from sending the password but it doesn't work... + (*asksent) = I_GetTime() - NEWTICRATE; // Send password immediately upon entering break; case CL_WAITJOINRESPONSE: From 892b4e77d96353d31d4f4d82ed42636758e19554 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:36:16 -0500 Subject: [PATCH 72/81] Make noises on the password entry screen --- src/d_clisrv.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 01304f38b..98330c84a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4001,11 +4001,23 @@ static void HandlePacketFromAwayNode(SINT8 node) cl_mode = CL_CHALLENGE; - if (cl_challengeattempted == 2) + switch (cl_challengeattempted) { - // We already sent a correct password, so throw it back up again. - D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_mode = CL_ASKJOIN; + case 2: + // We already sent a correct password, so throw it back up again. + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_mode = CL_ASKJOIN; + break; + + case 1: + // We entered the wrong password! + S_StartSound(NULL, sfx_s26d); + break; + + default: + // First entry to the password screen. + S_StartSound(NULL, sfx_s224); + break; } } break; @@ -4064,6 +4076,9 @@ static void HandlePacketFromAwayNode(SINT8 node) break; } + if (cl_challengeattempted == 1) // Successful password noise. + S_StartSound(NULL, sfx_s221); + cl_challengeattempted = 2; CONS_Printf("trying to download\n"); if (CL_SendRequestFile()) @@ -4085,6 +4100,9 @@ static void HandlePacketFromAwayNode(SINT8 node) if (cl_mode != CL_WAITJOINRESPONSE) break; + if (cl_challengeattempted == 1) // Successful password noise. + S_StartSound(NULL, sfx_s221); + if (client) { maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); From 40c77df7931e2808fb78c6d49dd5a53e533dcc84 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:43:39 -0500 Subject: [PATCH 73/81] Make sure we don't write kartspeed beyond SV_SPEEDMASK --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 98330c84a..0202ff6f4 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1364,7 +1364,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.kartvars = (UINT8) ( - cv_kartspeed.value | + (cv_kartspeed.value & SV_SPEEDMASK) | (dedicated ? SV_DEDICATED : 0) | (D_IsJoinPasswordOn() ? SV_PASSWORD : 0) ); From f4486cb11775e20a29aa0a2e61e5dc2c166e9344 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:54:17 -0500 Subject: [PATCH 74/81] Remove unnecessary padding byte from stored challenge answers --- src/d_netcmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2c6d60036..7c7f56902 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3712,7 +3712,7 @@ consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHEL #define NUMJOINCHALLENGES 32 static UINT8 joinpassmd5[MD5_LEN+1]; boolean joinpasswordset = false; -static UINT8 joinpasschallenges[NUMJOINCHALLENGES][MD5_LEN+1]; +static UINT8 joinpasschallenges[NUMJOINCHALLENGES][MD5_LEN]; static tic_t joinpasschallengeson[NUMJOINCHALLENGES]; boolean D_IsJoinPasswordOn(void) @@ -3752,7 +3752,7 @@ boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer) passed = true; // Wipe and reset the challenge so that it can't be tried against again, as a small measure against brute-force attacks. - memset(joinpasschallenges[num], 0x00, MD5_LEN+1); + memset(joinpasschallenges[num], 0x00, MD5_LEN); joinpasschallengeson[num] = 0; return passed; @@ -3787,7 +3787,7 @@ void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question) joinpasschallengeson[(*num)] = I_GetTime(); - memset(question, 0x00, MD5_LEN+1); + memset(question, 0x00, MD5_LEN); for (i = 0; i < MD5_LEN; i++) question[i] = M_RandomByte(); From a16243e84da1e584b3aaee9d2a91116f5884ae6d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 18:09:15 -0500 Subject: [PATCH 75/81] Deduplicate character shifting code --- src/console.c | 16 ++++++++++++++++ src/console.h | 2 ++ src/d_clisrv.c | 18 +----------------- src/hu_stuff.c | 13 +------------ 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/src/console.c b/src/console.c index 2b3ee0e22..44bb03a3d 100644 --- a/src/console.c +++ b/src/console.c @@ -544,6 +544,22 @@ static void CON_MoveConsole(void) } } +INT32 CON_ShiftChar(INT32 ch) +{ + if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) + { + if (shiftdown ^ capslock) + ch = shiftxform[ch]; + } + else // if we're holding shift we should still shift non letter symbols + { + if (shiftdown) + ch = shiftxform[ch]; + } + + return ch; +} + // Clear time of console heads up messages // void CON_ClearHUD(void) diff --git a/src/console.h b/src/console.h index 98df6ee2b..11621746c 100644 --- a/src/console.h +++ b/src/console.h @@ -44,6 +44,8 @@ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *or // Console bg color (auto updated to match) extern UINT8 *consolebgmap; +INT32 CON_ShiftChar(INT32 ch); + void CON_SetupBackColormap(void); void CON_ClearHUD(void); // clear heads up messages diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 0202ff6f4..5fe378e02 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2228,24 +2228,8 @@ boolean CL_Responder(event_t *ev) len = strlen(cl_challengepassword); if (len < 64) { - - // shifting code stolen from lat by fickle, thx :) - - // I know this looks very messy but this works. If it ain't broke, don't fix it! - // shift LETTERS to uppercase if we have capslock or are holding shift - if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) - { - if (shiftdown ^ capslock) - ch = shiftxform[ch]; - } - else // if we're holding shift we should still shift non letter symbols - { - if (shiftdown) - ch = shiftxform[ch]; - } - cl_challengepassword[len+1] = 0; - cl_challengepassword[len] = ch; + cl_challengepassword[len] = CON_ShiftChar(ch); } cl_challengeattempted = 0; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index a540e0a11..b43570735 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1293,18 +1293,7 @@ boolean HU_Responder(event_t *ev) && ev->data1 != gamecontrol[gc_talkkey][1])) return false; - // I know this looks very messy but this works. If it ain't broke, don't fix it! - // shift LETTERS to uppercase if we have capslock or are holding shift - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) - { - if (shiftdown ^ capslock) - c = shiftxform[c]; - } - else // if we're holding shift we should still shift non letter symbols - { - if (shiftdown) - c = shiftxform[c]; - } + c = CON_ShiftChar(c); // pasting. pasting is cool. chat is a bit limited, though :( if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE) From e59481735f740304d3dac5b5146f7c047b963ff8 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 10 Mar 2019 23:51:52 +0000 Subject: [PATCH 76/81] Fix compile warnings. --- src/d_clisrv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 5fe378e02..f337b170e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1214,7 +1214,7 @@ static inline void CL_DrawConnectionStatus(void) { char asterisks[33]; size_t sl = min(32, strlen(cl_challengepassword)); - UINT32 i; + UINT32 serverid; memset(asterisks, '*', sl); memset(asterisks+sl, 0, 33-sl); @@ -1222,9 +1222,9 @@ static inline void CL_DrawConnectionStatus(void) V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); V_DrawFixedPatch((BASEVIDWIDTH/2) << FRACBITS, (BASEVIDHEIGHT/2) << FRACBITS, FRACUNIT, 0, W_CachePatchName("BSRVLOCK", PU_CACHE), NULL); - i = SL_SearchServer(servernode); + serverid = SL_SearchServer(servernode); - if (i == -1) + if (serverid == UINT32_MAX) { M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8, 32, 1); V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_REDMAP, M_GetText("This server is password protected.")); @@ -1233,7 +1233,7 @@ static inline void CL_DrawConnectionStatus(void) { M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT/2-8, 32, 3); V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, V_REDMAP, M_GetText("This server,")); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+8, V_ALLOWLOWERCASE, serverlist[i].info.servername); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+8, V_ALLOWLOWERCASE, serverlist[serverid].info.servername); V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2+16, V_REDMAP, M_GetText("is password protected.")); } From fd59bfc3419885d2ec4ca4c16393240ed9c33886 Mon Sep 17 00:00:00 2001 From: Sryder Date: Mon, 11 Mar 2019 00:13:43 +0000 Subject: [PATCH 77/81] Move FORCECLOSE definition to be out of NONET ifdef Should this just be moved into d_net.h instead of defining it here and in d_net.c? --- src/d_clisrv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f337b170e..e227ce2ed 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -73,6 +73,7 @@ #define PREDICTIONQUEUE BACKUPTICS #define PREDICTIONMASK (PREDICTIONQUEUE-1) #define MAX_REASONLENGTH 30 +#define FORCECLOSE 0x8000 boolean server = true; // true or false but !server == client #define client (!server) @@ -1801,8 +1802,6 @@ static void SendAskInfo(INT32 node, boolean viams) serverelem_t serverlist[MAXSERVERLIST]; UINT32 serverlistcount = 0; -#define FORCECLOSE 0x8000 - static void SL_ClearServerList(INT32 connectedserver) { UINT32 i; From ebee7232c75cdb588649372f74e0e942fd72ac3d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 11 Mar 2019 00:10:03 -0500 Subject: [PATCH 78/81] Make sure Fairy is before Popcorn --- src/dehacked.c | 2 +- src/doomdef.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 97cf243f1..da1e471f6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8147,8 +8147,8 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "GREY", // SKINCOLOR_GREY "NICKEL", // SKINCOLOR_NICKEL "BLACK", // SKINCOLOR_BLACK - "POPCORN", // SKINCOLOR_POPCORN "FAIRY", // SKINCOLOR_FAIRY + "POPCORN", // SKINCOLOR_POPCORN "SEPIA", // SKINCOLOR_SEPIA "BEIGE", // SKINCOLOR_BEIGE "BROWN", // SKINCOLOR_BROWN diff --git a/src/doomdef.h b/src/doomdef.h index dcb7d7dd6..1cdcf52a2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -256,8 +256,8 @@ typedef enum SKINCOLOR_GREY, SKINCOLOR_NICKEL, SKINCOLOR_BLACK, - SKINCOLOR_POPCORN, SKINCOLOR_FAIRY, + SKINCOLOR_POPCORN, SKINCOLOR_SEPIA, SKINCOLOR_BEIGE, SKINCOLOR_BROWN, From 82d93a95fd0eaaf2eef8863908d344c13ac00d63 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 11 Mar 2019 00:28:30 -0500 Subject: [PATCH 79/81] Remove P_CanRunOnWater --- src/lua_baselib.c | 14 -------------- src/p_local.h | 2 -- src/p_map.c | 2 +- src/p_maputl.c | 4 ++-- src/p_mobj.c | 23 +---------------------- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 78f972f87..dde57c2dd 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -632,19 +632,6 @@ static int lib_pCheckSolidLava(lua_State *L) return 1; } -static int lib_pCanRunOnWater(lua_State *L) -{ - player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR)); - //HUDSAFE - if (!player) - return LUA_ErrInvalid(L, "player_t"); - if (!rover) - return LUA_ErrInvalid(L, "ffloor_t"); - lua_pushboolean(L, P_CanRunOnWater(player, rover)); - return 1; -} - static int lib_pSpawnShadowMobj(lua_State *L) { mobj_t *caster = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -2627,7 +2614,6 @@ static luaL_Reg lib[] = { {"P_InsideANonSolidFFloor",lib_pInsideANonSolidFFloor}, {"P_CheckDeathPitCollide",lib_pCheckDeathPitCollide}, {"P_CheckSolidLava",lib_pCheckSolidLava}, - {"P_CanRunOnWater",lib_pCanRunOnWater}, {"P_SpawnShadowMobj",lib_pSpawnShadowMobj}, // p_user diff --git a/src/p_local.h b/src/p_local.h index cf1387fee..1ac613bdb 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -274,8 +274,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab); mobj_t *P_GetClosestAxis(mobj_t *source); -boolean P_CanRunOnWater(player_t *player, ffloor_t *rover); - void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration); #define PAL_WHITE 1 #define PAL_MIXUP 2 diff --git a/src/p_map.c b/src/p_map.c index ccb666767..5ed886539 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2096,7 +2096,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) continue; } - if (thing->player && (P_CheckSolidLava(thing, rover) || P_CanRunOnWater(thing->player, rover))) + if (thing->player && P_CheckSolidLava(thing, rover)) ; else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)) ; diff --git a/src/p_maputl.c b/src/p_maputl.c index 1be57399c..c5a593d3e 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -649,7 +649,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && P_CheckSolidLava(mobj, rover)) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) @@ -693,7 +693,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) if (!(rover->flags & FF_EXISTS)) continue; - if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) + if (mobj->player && P_CheckSolidLava(mobj, rover)) ; else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) diff --git a/src/p_mobj.c b/src/p_mobj.c index 0130924c0..cf085370f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2004,7 +2004,7 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL); - if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected + if (mo->player && P_CheckSolidLava(mo, rover)) // only the player should be affected ; else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only continue; @@ -3127,27 +3127,6 @@ static boolean P_SceneryZMovement(mobj_t *mo) return true; } -// P_CanRunOnWater -// -// Returns true if player can waterrun on the 3D floor -// -boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) -{ - fixed_t topheight = -#ifdef ESLOPE - *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : -#endif - *rover->topheight; - - if ((player->mo->ceilingz-topheight >= player->mo->height) - && (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) - && !(player->pflags & PF_SLIDING) - && abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale)) - return false; - - return false; -} - // // P_MobjCheckWater // From ed0df9966dceb3f9b38da4896fd7ffec26cddceb Mon Sep 17 00:00:00 2001 From: Alam Arias Date: Mon, 11 Mar 2019 09:58:37 -0400 Subject: [PATCH 80/81] Fix compiling with VS --- src/hardware/r_opengl/r_opengl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 3a8be6a03..af3f3cb66 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2056,7 +2056,7 @@ EXPORT void HWRAPI(DrawMD2) (INT32 *gl_cmd_buffer, md2_frame_t *frame, FTransfor EXPORT void HWRAPI(SetTransform) (FTransform *stransform) { static boolean special_splitscreen; - float used_fov; + GLdouble used_fov; pglLoadIdentity(); if (stransform) { @@ -2088,7 +2088,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform) pglLoadIdentity(); if (special_splitscreen) { - used_fov = atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI; + used_fov = atan(tan(used_fov*M_PIl/360)*0.8)*360/M_PIl; GLPerspective(used_fov, 2*ASPECT_RATIO); } else From d0fe0abc9c69400d8a444a7941549510c696061f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 11 Mar 2019 17:23:41 -0500 Subject: [PATCH 81/81] Remove disableSpeedAdjust --- src/dehacked.c | 5 ----- src/doomstat.h | 1 - src/g_game.c | 1 - 3 files changed, 7 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 64a6242fc..d6d76b539 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3103,11 +3103,6 @@ static void readmaincfg(MYFILE *f) if (creditscutscene > 128) creditscutscene = 128; } - else if (fastcmp(word, "DISABLESPEEDADJUST")) - { - DEH_WriteUndoline(word, va("%d", disableSpeedAdjust), UNDO_NONE); - disableSpeedAdjust = (value || word2[0] == 'T' || word2[0] == 'Y'); - } else if (fastcmp(word, "NUMDEMOS")) { DEH_WriteUndoline(word, va("%d", numDemos), UNDO_NONE); diff --git a/src/doomstat.h b/src/doomstat.h index 9ae2726d7..9f021b640 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -57,7 +57,6 @@ extern boolean modifiedgame; extern boolean majormods; extern UINT16 mainwads; extern boolean savemoddata; // This mod saves time/emblem data. -extern boolean disableSpeedAdjust; // Don't alter the duration of player states if true extern boolean imcontinuing; // Temporary flag while continuing extern boolean metalrecording; diff --git a/src/g_game.c b/src/g_game.c index 47f50e57b..12544a8d0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -92,7 +92,6 @@ boolean majormods = false; // Set if Lua/Gameplay SOC/replacement map has been a boolean savemoddata = false; UINT8 paused; UINT8 modeattacking = ATTACKING_NONE; -boolean disableSpeedAdjust = true; boolean imcontinuing = false; boolean runemeraldmanager = false;