From e441b2bce4fb510cbcf34ccb7da30b8ed8f9aa73 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 20 Sep 2018 17:11:11 -0400 Subject: [PATCH] Address review (for anything code I did, anyway) --- src/command.c | 3 --- src/command.h | 1 - src/d_netcmd.c | 1 - src/d_netcmd.h | 1 - src/k_kart.c | 38 ++++++++++++++++++-------------------- src/p_enemy.c | 7 +++---- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/command.c b/src/command.c index a159ebcd..3ac1abb1 100644 --- a/src/command.c +++ b/src/command.c @@ -63,9 +63,6 @@ CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}}; //SRB2kart -/*CV_PossibleValue_t karthud_cons_t[] = { - {0, "Off"}, {1, "Default"}, {2, "SMK"}, {3, "MK64"}, - {0, NULL}};*/ CV_PossibleValue_t kartspeed_cons_t[] = { {0, "Easy"}, {1, "Normal"}, {2, "Hard"}, {0, NULL}}; diff --git a/src/command.h b/src/command.h index 0c2ef912..dbac8bd8 100644 --- a/src/command.h +++ b/src/command.h @@ -127,7 +127,6 @@ extern CV_PossibleValue_t CV_Unsigned[]; extern CV_PossibleValue_t CV_Natural[]; // SRB2kart -//extern CV_PossibleValue_t karthud_cons_t[]; extern CV_PossibleValue_t kartspeed_cons_t[]; // register a variable for use at the console diff --git a/src/d_netcmd.c b/src/d_netcmd.c index fa2d0032..e79224c4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -344,7 +344,6 @@ consvar_t cv_tripleorbinaut = {"tripleorbinaut", "On", CV_NETVAR|CV_CHEAT, C consvar_t cv_quadorbinaut = {"quadorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_dualjawz = {"dualjawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -//consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; consvar_t cv_kartminimap = {"kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 66c712c5..0a1cc3b7 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -117,7 +117,6 @@ extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring, cv_kitchensink; extern consvar_t cv_triplesneaker, cv_triplebanana, cv_decabanana; extern consvar_t cv_tripleorbinaut, cv_quadorbinaut, cv_dualjawz; -//extern consvar_t cv_karthud; extern consvar_t cv_kartminimap; extern consvar_t cv_kartcheck; extern consvar_t cv_kartinvinsfx; diff --git a/src/k_kart.c b/src/k_kart.c index 0ed5947c..d923c5c9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1247,8 +1247,19 @@ static void K_UpdateOffroad(player_t *player) player->kartstuff[k_offroad] = 0; } +// These have to go earlier than its sisters because of K_RespawnChecker... +static void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master) +{ + // flipping + mo->eflags = (mo->eflags & ~MFE_VERTICALFLIP)|(master->eflags & MFE_VERTICALFLIP); + // visibility (usually for hyudoro) + mo->flags2 = (mo->flags2 & ~MF2_DONTDRAW)|(master->flags2 & MF2_DONTDRAW); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP1)|(master->eflags & MFE_DRAWONLYFORP1); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP2)|(master->eflags & MFE_DRAWONLYFORP2); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP3)|(master->eflags & MFE_DRAWONLYFORP3); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP4)|(master->eflags & MFE_DRAWONLYFORP4); +} -// This has to go earlier than its sisters because of K_RespawnChecker... static void K_SpawnDashDustRelease(player_t *player) { fixed_t newx; @@ -1287,12 +1298,7 @@ static void K_SpawnDashDustRelease(player_t *player) dust->momy = 3*player->mo->momy/5; //dust->momz = 3*player->mo->momz/5; - dust->flags2 = (dust->flags2 & ~MF2_DONTDRAW)|(player->mo->flags2 & MF2_DONTDRAW); - dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - dust->eflags = (dust->eflags & ~MFE_DRAWONLYFORP1)|(player->mo->eflags & MFE_DRAWONLYFORP1); - dust->eflags = (dust->eflags & ~MFE_DRAWONLYFORP2)|(player->mo->eflags & MFE_DRAWONLYFORP2); - dust->eflags = (dust->eflags & ~MFE_DRAWONLYFORP3)|(player->mo->eflags & MFE_DRAWONLYFORP3); - dust->eflags = (dust->eflags & ~MFE_DRAWONLYFORP4)|(player->mo->eflags & MFE_DRAWONLYFORP4); + K_MatchGenericExtraFlags(dust, player->mo); } } @@ -1543,7 +1549,7 @@ void K_MomentumToFacing(player_t *player) player->mo->momy = FixedMul(player->mo->momy - player->cmomy, player->mo->friction) + player->cmomy; } -// if speed is true it gets the speed boost power, otherwise it gets the acceleration +// sets k_boostpower, k_speedboost, and k_accelboost to whatever we need it to be static void K_GetKartBoostPower(player_t *player) { fixed_t boostpower = FRACUNIT; @@ -2367,12 +2373,7 @@ static void K_SpawnDriftSparks(player_t *player) P_SetMobjState(spark, S_DRIFTSPARK_A1); } - spark->flags2 = (spark->flags2 & ~MF2_DONTDRAW)|(player->mo->flags2 & MF2_DONTDRAW); - spark->eflags = (spark->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - spark->eflags = (spark->eflags & ~MFE_DRAWONLYFORP1)|(player->mo->eflags & MFE_DRAWONLYFORP1); - spark->eflags = (spark->eflags & ~MFE_DRAWONLYFORP2)|(player->mo->eflags & MFE_DRAWONLYFORP2); - spark->eflags = (spark->eflags & ~MFE_DRAWONLYFORP3)|(player->mo->eflags & MFE_DRAWONLYFORP3); - spark->eflags = (spark->eflags & ~MFE_DRAWONLYFORP4)|(player->mo->eflags & MFE_DRAWONLYFORP4); + K_MatchGenericExtraFlags(spark, player->mo); } } @@ -2423,7 +2424,7 @@ void K_SpawnBoostTrail(player_t *player) flame->fuse = TICRATE*2; flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); - flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags so that a stolen sneaker can be seen flame->momx = 8; P_XYMovement(flame); @@ -2463,7 +2464,7 @@ void K_SpawnSparkleTrail(mobj_t *mo) P_SetTarget(&sparkle->target, mo); sparkle->destscale = mo->destscale; P_SetScale(sparkle, mo->scale); - sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); + sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags so that a stolen invincibility can be seen sparkle->color = mo->color; //sparkle->colorized = mo->colorized; } @@ -2484,7 +2485,7 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); dust->destscale = mo->scale; P_SetScale(dust, mo->scale); - dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); + dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags because hyudoro shouldn't be able to wipeout if (translucent) dust->flags2 |= MF2_SHADOW; @@ -4624,9 +4625,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } } - /*if (player->kartstuff[k_growshrinktimer] > 1) - player->powers[pw_flashing] = 2;*/ - // Friction if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) player->mo->friction += 4608; diff --git a/src/p_enemy.c b/src/p_enemy.c index a6c124db..ded0a20f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8172,10 +8172,7 @@ void A_JawzChase(mobj_t *actor) if (actor->tracer) { - if (!actor->tracer->health) - P_SetTarget(&actor->tracer, NULL); - - if (actor->tracer && actor->tracer->health) + if (actor->tracer->health) { mobj_t *ret; @@ -8187,6 +8184,8 @@ void A_JawzChase(mobj_t *actor) P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), actor->info->speed); return; } + else + P_SetTarget(&actor->tracer, NULL); } if (actor->extravalue1) // Disable looking by setting this