From c85206f6333dd384640aee20387ebbe89a84dde6 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 24 May 2022 21:36:44 +0100 Subject: [PATCH 01/26] Add P_SetAngle, P_SetPitch and P_SetRoll to the Lua API. --- src/lua_baselib.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 301665e45..bc09ba62b 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1484,6 +1484,43 @@ static int lib_pMoveOrigin(lua_State *L) return 2; } +static int lib_pSetAngle(lua_State *L) +{ + mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + angle_t newValue = luaL_checkangle(L, 2); + NOHUD + INLEVEL + + if (!thing) + return LUA_ErrInvalid(L, "mobj_t"); + P_InitAngle(thing, newValue); + return 0; +} + +static int lib_pSetPitch(lua_State *L) +{ + mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + angle_t newValue = luaL_checkangle(L, 2); + NOHUD + INLEVEL + if (!thing) + return LUA_ErrInvalid(L, "mobj_t"); + P_InitPitch(thing, newValue); + return 0; +} + +static int lib_pSetRoll(lua_State *L) +{ + mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + angle_t newValue = luaL_checkangle(L, 2); + NOHUD + INLEVEL + if (!thing) + return LUA_ErrInvalid(L, "mobj_t"); + P_InitRoll(thing, newValue); + return 0; +} + static int lib_pSlideMove(lua_State *L) { mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -3904,6 +3941,9 @@ static luaL_Reg lib[] = { {"P_TeleportMove",lib_pTeleportMove}, {"P_SetOrigin",lib_pSetOrigin}, {"P_MoveOrigin",lib_pMoveOrigin}, + {"P_SetAngle",lib_pSetAngle}, + {"P_SetPitch",lib_pSetPitch}, + {"P_SetRoll",lib_pSetRoll}, {"P_SlideMove",lib_pSlideMove}, {"P_BounceMove",lib_pBounceMove}, {"P_CheckSight", lib_pCheckSight}, From 3a4b485c5d171ae2b098195825f6e86dae8cc2dd Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 30 May 2022 18:15:52 +0100 Subject: [PATCH 02/26] Remove P_InitAngle and its kin, considered on a case-by-case basis for also setting old_angle as well. --- src/k_battle.c | 4 +-- src/k_collide.c | 3 +- src/k_follower.c | 2 +- src/k_kart.c | 56 +++++++++++++++--------------- src/k_race.c | 4 +-- src/k_respawn.c | 4 +-- src/lua_baselib.c | 9 +++-- src/p_enemy.c | 80 +++++++++++++++++++++---------------------- src/p_inter.c | 14 ++++---- src/p_local.h | 3 -- src/p_map.c | 27 +-------------- src/p_mobj.c | 86 +++++++++++++++++++++++------------------------ src/p_spec.c | 4 +-- src/p_telept.c | 3 +- src/p_user.c | 10 +++--- 15 files changed, 141 insertions(+), 168 deletions(-) diff --git a/src/k_battle.c b/src/k_battle.c index 14ecfabf5..575b54ffe 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -266,7 +266,7 @@ mobj_t *K_SpawnSphereBox(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 f { mobj_t *drop = P_SpawnMobj(x, y, z, MT_SPHEREBOX); - P_InitAngle(drop, angle); + drop->angle = angle; P_Thrust(drop, FixedAngle(P_RandomFixed() * 180) + angle, P_RandomRange(4, 12) * mapobjectscale); @@ -604,7 +604,7 @@ static void K_SpawnOvertimeLaser(fixed_t x, fixed_t y, fixed_t scale) mo->eflags |= MFE_VERTICALFLIP; } - P_InitAngle(mo, R_PointToAngle2(mo->x, mo->y, battleovertime.x, battleovertime.y) + ANGLE_90); + mo->angle = R_PointToAngle2(mo->x, mo->y, battleovertime.x, battleovertime.y) + ANGLE_90; mo->renderflags |= (RF_DONTDRAW & ~(K_GetPlayerDontDrawFlag(player))); P_SetScale(mo, scale); diff --git a/src/k_collide.c b/src/k_collide.c index 128364cfc..58719d508 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -572,7 +572,7 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2) if (t2deflect < ANG10) P_InstaThrust(t2, t2angle, t2speed); - P_InitAngle(t1, R_PointToAngle2(0, 0, t1->momx, t1->momy)); + t1->angle = t1->old_angle = R_PointToAngle2(0, 0, t1->momx, t1->momy); t1->reactiontime = 7*(t1speed+t2speed)/FRACUNIT; if (t1->reactiontime < 10) @@ -619,7 +619,6 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2) { blast->angle += ANGLE_90; } - P_InitAngle(blast, blast->angle); blast->destscale *= 10; } diff --git a/src/k_follower.c b/src/k_follower.c index 2a5f92a05..53c211458 100644 --- a/src/k_follower.c +++ b/src/k_follower.c @@ -330,7 +330,7 @@ void K_HandleFollower(player_t *player) K_UpdateFollowerState(player->follower, fl.idlestate, FOLLOWERSTATE_IDLE); P_SetTarget(&player->follower->target, player->mo); // we need that to know when we need to disappear - P_InitAngle(player->follower, player->mo->angle); + player->follower->angle = player->follower->old_angle = player->mo->angle; // This is safe to only spawn it here, the follower is removed then respawned when switched. if (bubble) diff --git a/src/k_kart.c b/src/k_kart.c index f8412f0d1..4d3424dce 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2053,7 +2053,7 @@ void K_SpawnDashDustRelease(player_t *player) dust = P_SpawnMobj(newx, newy, player->mo->z, MT_FASTDUST); P_SetTarget(&dust->target, player->mo); - P_InitAngle(dust, travelangle - ((i&1) ? -1 : 1) * ANGLE_45); + dust->angle = travelangle - (((i&1) ? -1 : 1) * ANGLE_45); dust->destscale = player->mo->scale; P_SetScale(dust, player->mo->scale); @@ -2217,7 +2217,7 @@ void K_SpawnNormalSpeedLines(player_t *player) MT_FASTLINE); P_SetTarget(&fast->target, player->mo); - P_InitAngle(fast, K_MomentumAngle(player->mo)); + fast->angle = K_MomentumAngle(player->mo); fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; fast->momz = 3*P_GetMobjZMovement(player->mo)/4; @@ -2268,7 +2268,7 @@ void K_SpawnInvincibilitySpeedLines(mobj_t *mo) P_SetMobjState(fast, S_KARTINVLINES1); P_SetTarget(&fast->target, mo); - P_InitAngle(fast, K_MomentumAngle(mo)); + fast->angle = K_MomentumAngle(mo); fast->momx = 3*mo->momx/4; fast->momy = 3*mo->momy/4; @@ -3958,7 +3958,7 @@ void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount) P_SetTarget(&newmo->tracer, victim->mo); P_SetTarget(&newmo->target, player->mo); - P_InitAngle(newmo, (diff * (newbumper-1))); + newmo->angle = (diff * (newbumper-1)); newmo->color = victim->skincolor; if (newbumper+1 < 2) @@ -4046,7 +4046,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) { dust = P_SpawnMobj(source->x, source->y, source->z, MT_SMOKE); P_SetMobjState(dust, S_OPAQUESMOKE1); - P_InitAngle(dust, (ANGLE_180/16) * i); + dust->angle = (ANGLE_180/16) * i; P_SetScale(dust, source->scale); dust->destscale = source->scale*10; dust->scalespeed = source->scale/12; @@ -4196,7 +4196,7 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I th->z = th->floorz; } - P_InitAngle(th, an); + th->angle = an; th->momx = FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); @@ -4369,7 +4369,7 @@ static void K_SpawnDriftElectricity(player_t *player) y = P_ReturnThrustY(mo, verticalangle, verticalradius) + P_ReturnThrustY(mo, horizonatalangle, horizontalradius); spark = P_SpawnMobjFromMobj(mo, x, y, 0, MT_DRIFTELECTRICITY); - P_InitAngle(spark, sparkangle); + spark->angle = sparkangle; spark->momx = mo->momx; spark->momy = mo->momy; spark->momz = mo->momz; @@ -4414,7 +4414,7 @@ void K_SpawnDriftElectricSparks(player_t *player) fixed_t yoff = P_ReturnThrustY(mo, sparkangle, sparkradius); mobj_t *spark = P_SpawnMobjFromMobj(mo, x + xoff, y + yoff, z, MT_DRIFTELECTRICSPARK); - P_InitAngle(spark, sparkangle); + spark->angle = sparkangle; spark->color = color; P_InstaThrust(spark, mo->angle + ANGLE_90, hspeed); P_SetObjectMomZ(spark, vspeed, false); @@ -4465,7 +4465,7 @@ static void K_SpawnDriftSparks(player_t *player) spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK); P_SetTarget(&spark->target, player->mo); - P_InitAngle(spark, travelangle-(ANGLE_45/5)*player->drift); + spark->angle = travelangle-((ANGLE_45/5)*player->drift); spark->destscale = player->mo->scale; P_SetScale(spark, player->mo->scale); @@ -4609,7 +4609,7 @@ static void K_SpawnAIZDust(player_t *player) newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle - (player->aizdriftstrat*ANGLE_45), FixedMul(24*FRACUNIT, player->mo->scale)); spark = P_SpawnMobj(newx, newy, player->mo->z, MT_AIZDRIFTSTRAT); - P_InitAngle(spark, travelangle+(player->aizdriftstrat*ANGLE_90)); + spark->angle = travelangle+(player->aizdriftstrat*ANGLE_90); P_SetScale(spark, (spark->destscale = (3*player->mo->scale)>>2)); spark->momx = (6*player->mo->momx)/5; @@ -4661,7 +4661,7 @@ void K_SpawnBoostTrail(player_t *player) flame = P_SpawnMobj(newx, newy, ground, MT_SNEAKERTRAIL); P_SetTarget(&flame->target, player->mo); - P_InitAngle(flame, travelangle); + flame->angle = travelangle; flame->fuse = TICRATE*2; flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); @@ -4708,7 +4708,7 @@ void K_SpawnSparkleTrail(mobj_t *mo) sparkle = P_SpawnMobj(newx, newy, newz, MT_SPARKLETRAIL); - P_InitAngle(sparkle, R_PointToAngle2(mo->x, mo->y, sparkle->x, sparkle->y)); + sparkle->angle = R_PointToAngle2(mo->x, mo->y, sparkle->x, sparkle->y); sparkle->movefactor = R_PointToDist2(mo->x, mo->y, sparkle->x, sparkle->y); // Save the distance we spawned away from the player. //CONS_Printf("movefactor: %d\n", sparkle->movefactor/FRACUNIT); @@ -4758,7 +4758,7 @@ void K_SpawnWipeoutTrail(mobj_t *mo) mo->z, MT_WIPEOUTTRAIL); P_SetTarget(&dust->target, mo); - P_InitAngle(dust, K_MomentumAngle(mo)); + dust->angle = K_MomentumAngle(mo); dust->destscale = mo->scale; P_SetScale(dust, mo->scale); K_FlipFromObject(dust, mo); @@ -4824,7 +4824,7 @@ void K_SpawnDraftDust(mobj_t *mo) P_SetMobjState(dust, S_DRAFTDUST1 + foff); P_SetTarget(&dust->target, mo); - P_InitAngle(dust, ang - (ANGLE_90 * sign)); // point completely perpendicular from the player + dust->angle = ang - (ANGLE_90 * sign); // point completely perpendicular from the player dust->destscale = mo->scale; P_SetScale(dust, mo->scale); K_FlipFromObject(dust, mo); @@ -4999,7 +4999,7 @@ static void K_SpawnTripwireVFX(mobj_t *mo) mo->z, MT_DRIFTDUST); P_SetTarget(&dust->target, mo); - P_InitAngle(dust, ang - (ANGLE_90 * sign)); // point completely perpendicular from the player + dust->angle = ang - (ANGLE_90 * sign); // point completely perpendicular from the player P_SetScale(dust, mo->scale); dust->destscale = mo->scale * 6; dust->scalespeed = mo->scale/12; @@ -5444,7 +5444,7 @@ static void K_DoLightningShield(player_t *player) for (i=0; i<7; i++) { mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK); - P_InitAngle(mo, P_RandomRange(0, 359)*ANG1); + mo->angle = P_RandomRange(0, 359)*ANG1; mo->fuse = P_RandomRange(20, 50); P_SetTarget(&mo->target, player->mo); P_SetMobjState(mo, S_KLIT1); @@ -5457,7 +5457,7 @@ static void K_DoLightningShield(player_t *player) sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT)); sy = player->mo->y + FixedMul((player->mo->scale*THUNDERRADIUS), FINESINE((an*i)>>ANGLETOFINESHIFT)); mo = P_SpawnMobj(sx, sy, player->mo->z, MT_THOK); - P_InitAngle(mo, an*i); + mo->angle = an*i; mo->extravalue1 = THUNDERRADIUS; // Used to know whether we should teleport by radius or something. mo->scale = player->mo->scale*3; P_SetTarget(&mo->target, player->mo); @@ -5782,7 +5782,7 @@ static void K_ThrowLandMine(player_t *player) P_SetScale(landMine, player->mo->scale); landMine->destscale = player->mo->destscale; - P_InitAngle(landMine, player->mo->angle); + landMine->angle = player->mo->angle; landMine->momz = (30 * mapobjectscale * P_MobjFlip(player->mo)) + player->mo->momz; landMine->color = player->skincolor; @@ -6099,7 +6099,7 @@ mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 P_SetScale(drop, drop->scale>>4); drop->destscale = (3*drop->destscale)/2; - P_InitAngle(drop, angle); + drop->angle = angle; P_Thrust(drop, FixedAngle(P_RandomFixed() * 180) + angle, 16*mapobjectscale); @@ -7607,7 +7607,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { mobj_t *ring = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RING); ring->extravalue1 = 1; // Ring collect animation timer - P_InitAngle(ring, player->mo->angle); // animation angle + ring->angle = player->mo->angle; // animation angle P_SetTarget(&ring->target, player->mo); // toucher for thinker player->pickuprings++; if (player->superring <= 3) @@ -8575,7 +8575,7 @@ void K_SpawnDriftBoostExplosion(player_t *player, int stage) { mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_DRIFTEXPLODE); - P_InitAngle(overlay, K_MomentumAngle(player->mo)); + overlay->angle = K_MomentumAngle(player->mo); P_SetTarget(&overlay->target, player->mo); P_SetScale(overlay, (overlay->destscale = player->mo->scale)); K_FlipFromObject(overlay, player->mo); @@ -9255,9 +9255,9 @@ static void K_KartSpindashWind(mobj_t *parent) P_SetTarget(&wind->target, parent); if (parent->momx || parent->momy) - P_InitAngle(wind, R_PointToAngle2(0, 0, parent->momx, parent->momy)); + wind->angle = R_PointToAngle2(0, 0, parent->momx, parent->momy); else - P_InitAngle(wind, parent->player->drawangle); + wind->angle = parent->player->drawangle; wind->momx = 3 * parent->momx / 4; wind->momy = 3 * parent->momy / 4; @@ -9306,7 +9306,7 @@ static void K_KartSpindash(player_t *player) mobj_t *grease; grease = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_TIREGREASE); P_SetTarget(&grease->target, player->mo); - P_InitAngle(grease, K_MomentumAngle(player->mo)); + grease->angle = K_MomentumAngle(player->mo); grease->extravalue1 = i; } } @@ -9741,7 +9741,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_ROCKETSNEAKER); K_MatchGenericExtraFlags(mo, player->mo); mo->flags |= MF_NOCLIPTHING; - P_InitAngle(mo, player->mo->angle); + mo->angle = player->mo->angle; mo->threshold = 10; mo->movecount = moloop%2; mo->movedir = mo->lastlook = moloop+1; @@ -9841,7 +9841,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) break; } mo->flags |= MF_NOCLIPTHING; - P_InitAngle(mo, newangle); + mo->angle = newangle; mo->threshold = 10; mo->movecount = player->itemamount; mo->movedir = mo->lastlook = moloop+1; @@ -9883,7 +9883,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) break; } mo->flags |= MF_NOCLIPTHING; - P_InitAngle(mo, newangle); + mo->angle = newangle; mo->threshold = 10; mo->movecount = player->itemamount; mo->movedir = mo->lastlook = moloop+1; @@ -10345,7 +10345,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) spdl = P_SpawnMobj(sx, sy, sz, MT_FASTLINE); P_SetTarget(&spdl->target, player->mo); - P_InitAngle(spdl, R_PointToAngle2(spdl->x, spdl->y, player->mo->x, player->mo->y)); + spdl->angle = R_PointToAngle2(spdl->x, spdl->y, player->mo->x, player->mo->y); spdl->rollangle = -ANG1*90*P_MobjFlip(player->mo); // angle them downwards relative to the player's gravity... spdl->spriteyscale = player->trickboostpower+FRACUNIT; spdl->momx = player->mo->momx; diff --git a/src/k_race.c b/src/k_race.c index fde4c9be2..1354b9d56 100644 --- a/src/k_race.c +++ b/src/k_race.c @@ -370,7 +370,7 @@ static void K_DrawFinishLineBeamForLine(fixed_t offset, angle_t aiming, line_t * P_SetMobjState(end1, S_FINISHBEAMEND1); end1->renderflags = RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(&players[displayplayers[i]]); - P_InitAngle(end1, lineangle); + end1->angle = lineangle; end2 = P_SpawnMobj( v->x + (8*sx), @@ -381,7 +381,7 @@ static void K_DrawFinishLineBeamForLine(fixed_t offset, angle_t aiming, line_t * P_SetMobjState(end2, S_FINISHBEAMEND2); end2->renderflags = RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(&players[displayplayers[i]]); - P_InitAngle(end2, lineangle); + end2->angle = lineangle; P_SetTarget(&end2->tracer, end1); end2->flags2 |= MF2_LINKDRAW; diff --git a/src/k_respawn.c b/src/k_respawn.c index 9a8cc38e8..ef2a4c9f9 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -575,7 +575,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player) P_SetTarget(&lasermo->target, player->mo); - P_InitAngle(lasermo, stepha + ANGLE_90); + lasermo->angle = stepha + ANGLE_90; P_SetScale(lasermo, (lasermo->destscale = player->mo->scale)); } } @@ -638,7 +638,7 @@ static void K_DropDashWait(player_t *player) P_SetTarget(&laser->target, player->mo); - P_InitAngle(laser, newangle + ANGLE_90); + laser->angle = newangle + ANGLE_90; laser->momz = (8 * player->mo->scale) * P_MobjFlip(player->mo); P_SetScale(laser, (laser->destscale = player->mo->scale)); } diff --git a/src/lua_baselib.c b/src/lua_baselib.c index bc09ba62b..76c244cdf 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1493,7 +1493,8 @@ static int lib_pSetAngle(lua_State *L) if (!thing) return LUA_ErrInvalid(L, "mobj_t"); - P_InitAngle(thing, newValue); + //P_SetAngle(thing, newValue); + thing->angle = thing->old_angle = newValue; return 0; } @@ -1505,7 +1506,8 @@ static int lib_pSetPitch(lua_State *L) INLEVEL if (!thing) return LUA_ErrInvalid(L, "mobj_t"); - P_InitPitch(thing, newValue); + //P_SetPitch(thing, newValue); + thing->pitch = thing->old_pitch = newValue; return 0; } @@ -1517,7 +1519,8 @@ static int lib_pSetRoll(lua_State *L) INLEVEL if (!thing) return LUA_ErrInvalid(L, "mobj_t"); - P_InitRoll(thing, newValue); + //P_SetRoll(thing, newValue); + thing->roll = thing->old_roll = newValue; return 0; } diff --git a/src/p_enemy.c b/src/p_enemy.c index 2c69e7bfe..9a9df8093 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1221,7 +1221,7 @@ void A_StatueBurst(mobj_t *actor) if (!locvar1 || !(new = P_SpawnMobjFromMobj(actor, 0, 0, 0, locvar1))) return; - P_InitAngle(new, actor->angle); + new->angle = actor->angle; P_SetTarget(&new->target, actor->target); if (locvar2) P_SetMobjState(new, (statenum_t)locvar2); @@ -2509,7 +2509,7 @@ void A_LobShot(mobj_t *actor) P_SetTarget(&shot->target, actor); // where it came from - P_InitAngle(shot, actor->angle); + shot->angle = actor->angle; an = actor->angle >> ANGLETOFINESHIFT; dist = P_AproxDistance(actor->target->x - shot->x, actor->target->y - shot->y); @@ -2876,7 +2876,7 @@ void A_Boss1Laser(mobj_t *actor) S_StartSound(actor, mobjinfo[locvar1].seesound); point = P_SpawnMobj(x + P_ReturnThrustX(actor, actor->angle, actor->radius), y + P_ReturnThrustY(actor, actor->angle, actor->radius), actor->z - actor->height / 2, MT_EGGMOBILE_TARGET); - P_InitAngle(point, actor->angle); + point->angle = actor->angle; point->fuse = dur+1; P_SetTarget(&point->target, actor->target); P_SetTarget(&actor->target, point); @@ -2886,7 +2886,7 @@ void A_Boss1Laser(mobj_t *actor) point = P_SpawnMobj(x, y, z, locvar1); P_SetTarget(&point->target, actor); - P_InitAngle(point, actor->angle); + point->angle = actor->angle; speed = point->radius; point->momz = FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT), speed); point->momx = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(point->angle>>ANGLETOFINESHIFT), speed)); @@ -2895,7 +2895,7 @@ void A_Boss1Laser(mobj_t *actor) for (i = 0; i < 256; i++) { mobj_t *mo = P_SpawnMobj(point->x, point->y, point->z, point->type); - P_InitAngle(mo, point->angle); + mo->angle = point->angle; mo->color = LASERCOLORS[((UINT8)(i + 3*dur) >> 2) % sizeof(LASERCOLORS)]; // codeing P_UnsetThingPosition(mo); mo->flags = MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY; @@ -2927,7 +2927,7 @@ void A_Boss1Laser(mobj_t *actor) if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1 && dur & 1) { point = P_SpawnMobj(x, y, floorz, MT_EGGMOBILE_FIRE); - P_InitAngle(point, actor->angle); + point->angle = actor->angle; point->destscale = actor->scale; P_SetScale(point, point->destscale); P_SetTarget(&point->target, actor); @@ -3511,7 +3511,7 @@ bossjustdie: P_ReturnThrustX(mo, mo->angle - ANGLE_90, 32<angle - ANGLE_90, 32<angle); + mo2->angle = mo->angle; P_InstaThrust(mo2, mo2->angle - ANGLE_90, 4*mo2->scale); P_SetObjectMomZ(mo2, 4*FRACUNIT, false); P_SetMobjState(mo2, S_BOSSEGLZ1); @@ -3520,7 +3520,7 @@ bossjustdie: P_ReturnThrustX(mo, mo->angle + ANGLE_90, 32<angle + ANGLE_90, 32<angle); + mo2->angle = mo->angle; P_InstaThrust(mo2, mo2->angle + ANGLE_90, 4*mo2->scale); P_SetObjectMomZ(mo2, 4*FRACUNIT, false); P_SetMobjState(mo2, S_BOSSEGLZ2); @@ -3532,7 +3532,7 @@ bossjustdie: P_ReturnThrustX(mo, mo->angle - ANGLE_90, 32<angle - ANGLE_90, 32<angle); + mo2->angle = mo->angle; P_InstaThrust(mo2, mo2->angle - ANGLE_90, 4*mo2->scale); P_SetObjectMomZ(mo2, 4*FRACUNIT, false); P_SetMobjState(mo2, S_BOSSTANK1); @@ -3541,7 +3541,7 @@ bossjustdie: P_ReturnThrustX(mo, mo->angle + ANGLE_90, 32<angle + ANGLE_90, 32<angle); + mo2->angle = mo->angle; P_InstaThrust(mo2, mo2->angle + ANGLE_90, 4*mo2->scale); P_SetObjectMomZ(mo2, 4*FRACUNIT, false); P_SetMobjState(mo2, S_BOSSTANK2); @@ -3549,7 +3549,7 @@ bossjustdie: mo2 = P_SpawnMobjFromMobj(mo, 0, 0, mobjinfo[MT_EGGMOBILE2].height + (32<angle); + mo2->angle = mo->angle; P_SetObjectMomZ(mo2, 4*FRACUNIT, false); mo2->momz += mo->momz; P_SetMobjState(mo2, S_BOSSSPIGOT); @@ -3558,7 +3558,7 @@ bossjustdie: case MT_EGGMOBILE3: { mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_BOSSJUNK); - P_InitAngle(mo2, mo->angle); + mo2->angle = mo->angle; P_SetMobjState(mo2, S_BOSSSEBH1); } break; @@ -3610,8 +3610,8 @@ bossjustdie: pole->tracer->flags |= MF_NOCLIPTHING; P_SetScale(pole, (pole->destscale = 2*FRACUNIT)); P_SetScale(pole->tracer, (pole->tracer->destscale = 2*FRACUNIT)); - P_InitAngle(pole, mo->tracer->angle); - P_InitAngle(pole->tracer, mo->tracer->angle); + pole->angle = mo->tracer->angle; + pole->tracer->angle = mo->tracer->angle; pole->tracer->tracer->angle = pole->angle - ANGLE_90; pole->momx = P_ReturnThrustX(pole, pole->angle, speed); pole->momy = P_ReturnThrustY(pole, pole->angle, speed); @@ -3980,7 +3980,7 @@ void A_AttractChase(mobj_t *actor) sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS); P_SetTarget(&sparkle->target, actor->target); - P_InitAngle(sparkle, (actor->target->angle + (offset>>1)) + (offset * actor->target->player->sparkleanim)); + sparkle->angle = (actor->target->angle + (offset>>1)) + (offset * actor->target->player->sparkleanim); actor->target->player->sparkleanim = (actor->target->player->sparkleanim+1) % 20; P_KillMobj(actor, actor->target, actor->target, DMG_NORMAL); @@ -5264,7 +5264,7 @@ void A_RockSpawn(mobj_t *actor) mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FALLINGROCK); P_SetMobjState(mo, mobjinfo[type].spawnstate); - P_InitAngle(mo, R_PointToAngle2(line->v2->x, line->v2->y, line->v1->x, line->v1->y)); + mo->angle = R_PointToAngle2(line->v2->x, line->v2->y, line->v1->x, line->v1->y); P_InstaThrust(mo, mo->angle, dist + randomoomph); mo->momz = dist + randomoomph; @@ -7010,7 +7010,7 @@ void A_Boss3ShockThink(mobj_t *actor) snew->momx = (actor->momx + snext->momx) >> 1; snew->momy = (actor->momy + snext->momy) >> 1; snew->momz = (actor->momz + snext->momz) >> 1; // is this really needed? - P_InitAngle(snew, (actor->angle + snext->angle) >> 1); + snew->angle = (actor->angle + snext->angle) >> 1; P_SetTarget(&snew->target, actor->target); snew->fuse = actor->fuse; @@ -7166,7 +7166,7 @@ void A_SpawnObjectAbsolute(mobj_t *actor) mo = P_SpawnMobj(x<angle); + mo->angle = actor->angle; if (actor->eflags & MFE_VERTICALFLIP) mo->flags2 |= MF2_OBJECTFLIP; @@ -7208,7 +7208,7 @@ void A_SpawnObjectRelative(mobj_t *actor) (actor->eflags & MFE_VERTICALFLIP) ? ((actor->z + actor->height - mobjinfo[type].height) - FixedMul(z<scale)) : (actor->z + FixedMul(z<scale)), type); // Spawn objects with an angle matching the spawner's, rather than spawning Eastwards - Monster Iestyn - P_InitAngle(mo, actor->angle); + mo->angle = actor->angle; if (actor->eflags & MFE_VERTICALFLIP) mo->flags2 |= MF2_OBJECTFLIP; @@ -7918,7 +7918,7 @@ void A_BossJetFume(mobj_t *actor) P_SetScale(filler, filler->destscale); if (actor->eflags & MFE_VERTICALFLIP) filler->flags2 |= MF2_OBJECTFLIP; - P_InitAngle(filler, actor->angle - ANGLE_180); + filler->angle = actor->angle - ANGLE_180; P_SetTarget(&actor->tracer, filler); }*/ @@ -9671,7 +9671,7 @@ void A_TrapShot(mobj_t *actor) S_StartSound(missile, missile->info->seesound); P_SetTarget(&missile->target, actor); - P_InitAngle(missile, actor->angle); + missile->angle = actor->angle; speed = FixedMul(missile->info->speed, missile->scale); @@ -10248,7 +10248,7 @@ void A_BrakLobShot(mobj_t *actor) S_StartSound(shot, shot->info->seesound); P_SetTarget(&shot->target, actor); // where it came from - P_InitAngle(shot, actor->angle); + shot->angle = actor->angle; // Horizontal axes first. First parameter is initial horizontal impulse, second is to correct its angle. shot->momx = FixedMul(FixedMul(v, FINECOSINE(theta >> ANGLETOFINESHIFT)), FINECOSINE(shot->angle >> ANGLETOFINESHIFT)); @@ -10315,7 +10315,7 @@ void A_NapalmScatter(mobj_t *actor) mo = P_SpawnMobj(actor->x, actor->y, actor->z, typeOfShot); P_SetTarget(&mo->target, actor->target); // Transfer target so Brak doesn't hit himself like an idiot - P_InitAngle(mo, fa << ANGLETOFINESHIFT); + mo->angle = fa << ANGLETOFINESHIFT; mo->momx = FixedMul(FINECOSINE(fa),vx); mo->momy = FixedMul(FINESINE(fa),vx); mo->momz = vy; @@ -10339,7 +10339,7 @@ void A_SpawnFreshCopy(mobj_t *actor) newObject = P_SpawnMobjFromMobj(actor, 0, 0, 0, actor->type); newObject->flags2 = actor->flags2 & MF2_AMBUSH; - P_InitAngle(newObject, actor->angle); + newObject->angle = actor->angle; newObject->color = actor->color; P_SetTarget(&newObject->target, actor->target); P_SetTarget(&newObject->tracer, actor->tracer); @@ -10375,7 +10375,7 @@ mobj_t *P_InternalFlickySpawn(mobj_t *actor, mobjtype_t flickytype, fixed_t momz } flicky = P_SpawnMobjFromMobj(actor, offsx, offsy, 0, flickytype); - P_InitAngle(flicky, actor->angle); + flicky->angle = actor->angle; if (flickytype == MT_SEED) flicky->z += P_MobjFlip(actor)*(actor->height - flicky->height)/2; @@ -10525,7 +10525,7 @@ void A_FlickyCenter(mobj_t *actor) else if (actor->flags & MF_SLIDEME) // aimless { actor->tracer->fuse = 0; // less than 2*TICRATE means move aimlessly. - P_InitAngle(actor->tracer, P_RandomKey(180)*ANG2); + actor->tracer->angle = P_RandomKey(180)*ANG2; } else //orbit actor->tracer->fuse = FRACUNIT; @@ -11222,7 +11222,7 @@ void A_ConnectToGround(mobj_t *actor) { work = P_SpawnMobjFromMobj(actor, 0, 0, workz, locvar1); if (work) - P_InitAngle(work, ang); + work->angle = ang; ang += ANGLE_90; workz += workh; } @@ -11268,7 +11268,7 @@ void A_SpawnParticleRelative(mobj_t *actor) (actor->eflags & MFE_VERTICALFLIP) ? ((actor->z + actor->height - mobjinfo[MT_PARTICLE].height) - FixedMul(z<scale)) : (actor->z + FixedMul(z<scale)), MT_PARTICLE); // Spawn objects with an angle matching the spawner's, rather than spawning Eastwards - Monster Iestyn - P_InitAngle(mo, actor->angle); + mo->angle = actor->angle; if (actor->eflags & MFE_VERTICALFLIP) mo->flags2 |= MF2_OBJECTFLIP; @@ -12015,7 +12015,7 @@ void A_Boss5MakeJunk(mobj_t *actor) broked->fuse = TICRATE; else broked->fuse = (((locvar2 & 1) ? 4 : 2)*TICRATE)/3; - P_InitAngle(broked, ang); + broked->angle = ang; P_InstaThrust(broked, ang, ((locvar2 & 2) ? 8 : 5)*actor->scale); P_SetObjectMomZ(broked, (((locvar2) ? 4 : 0) + P_RandomRange(2, 5))< 0) @@ -12094,7 +12094,7 @@ static void P_DustRing(mobjtype_t mobjtype, UINT32 div, fixed_t x, fixed_t y, fi mobjtype ); - P_InitAngle(dust, ang*i + ANGLE_90); + dust->angle = ang*i + ANGLE_90; P_SetScale(dust, FixedMul(initscale, scale)); dust->destscale = FixedMul(4*FRACUNIT + P_RandomFixed(), scale); dust->scalespeed = scale/24; @@ -12299,7 +12299,7 @@ static mobj_t *P_TrainSeg(mobj_t *src, fixed_t x, fixed_t y, fixed_t z, angle_t s->fuse = 16*TICRATE; s->sprite = spr; s->frame = frame|FF_PAPERSPRITE; - P_InitAngle(s, ang); + s->angle = ang; P_Thrust(s, src->angle, 7*FRACUNIT); return s; } @@ -12671,7 +12671,7 @@ void A_SaloonDoorSpawn(mobj_t *actor) // One door... if (!(door = P_SpawnMobjFromMobj(actor, c, s, 0, locvar1))) return; - P_InitAngle(door, ang + ANGLE_180); + door->angle = ang + ANGLE_180; door->extravalue1 = AngleFixed(door->angle); // Origin angle door->extravalue2 = 0; // Angular speed P_SetTarget(&door->tracer, actor); // Origin door @@ -12679,7 +12679,7 @@ void A_SaloonDoorSpawn(mobj_t *actor) // ...two door! if (!(door = P_SpawnMobjFromMobj(actor, -c, -s, 0, locvar1))) return; - P_InitAngle(door, ang); + door->angle = ang; door->extravalue1 = AngleFixed(door->angle); // Origin angle door->extravalue2 = 0; // Angular speed P_SetTarget(&door->tracer, actor); // Origin door @@ -12875,7 +12875,7 @@ void A_SpawnPterabytes(mobj_t *actor) c = FINECOSINE(fa); s = FINESINE(fa); waypoint = P_SpawnMobjFromMobj(actor, FixedMul(c, rad), FixedMul(s, rad), 0, MT_PTERABYTEWAYPOINT); - P_InitAngle(waypoint, ang + ANGLE_90); + waypoint->angle = ang + ANGLE_90; P_SetTarget(&waypoint->tracer, actor); ptera = P_SpawnMobjFromMobj(waypoint, 0, 0, 0, MT_PTERABYTE); ptera->angle = waypoint->angle; @@ -13049,7 +13049,7 @@ void A_DragonbomberSpawn(mobj_t *actor) segment = P_SpawnMobjFromMobj(mo, x, y, 0, MT_DRAGONTAIL); P_SetTarget(&segment->target, mo); P_SetTarget(&mo->tracer, segment); - P_InitAngle(segment, mo->angle); + segment->angle = mo->angle; mo = segment; } for (i = 0; i < 2; i++) // spawn wings @@ -13465,7 +13465,7 @@ static void SpawnSPBDust(mobj_t *mo) P_SetScale(dust, mo->scale*2); dust->colorized = true; dust->color = SKINCOLOR_RED; - P_InitAngle(dust, mo->angle - FixedAngle(FRACUNIT*90 - FRACUNIT*180*i)); // The first one will spawn to the right of the spb, the second one to the left. + dust->angle = mo->angle - FixedAngle(FRACUNIT*90 - FRACUNIT*180*i); // The first one will spawn to the right of the spb, the second one to the left. P_Thrust(dust, dust->angle, 6*dust->scale); K_MatchGenericExtraFlags(dust, mo); @@ -13502,7 +13502,7 @@ static void SpawnSPBAIZDust(mobj_t *mo, INT32 dir) spark->flags = MF_NOGRAVITY|MF_PAIN; P_SetTarget(&spark->target, mo); - P_InitAngle(spark, travelangle+(dir*ANGLE_90)); + spark->angle = travelangle+(dir*ANGLE_90); P_SetScale(spark, (spark->destscale = mo->scale*3/2)); spark->momx = (6*mo->momx)/5; @@ -13521,7 +13521,7 @@ static void SpawnSPBSpeedLines(mobj_t *actor) MT_FASTLINE); P_SetTarget(&fast->target, actor); - P_InitAngle(fast, K_MomentumAngle(actor)); + fast->angle = K_MomentumAngle(actor); fast->color = SKINCOLOR_RED; fast->colorized = true; K_MatchGenericExtraFlags(fast, actor); @@ -14111,7 +14111,7 @@ void A_RandomShadowFrame(mobj_t *actor) P_SetScale(fake, FRACUNIT*3/2); fake->scale = FRACUNIT*3/2; fake->destscale = FRACUNIT*3/2; - P_InitAngle(fake, actor->angle); + fake->angle = actor->angle; fake->tics = -1; actor->renderflags |= RF_DONTDRAW; actor->extravalue1 = 1; @@ -14499,8 +14499,6 @@ void A_FlameShieldPaper(mobj_t *actor) paper->frame |= framea; } - P_InitAngle(paper, paper->angle); - paper->extravalue1 = i; } } diff --git a/src/p_inter.c b/src/p_inter.c index 0974e11d7..fcde34c23 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1202,7 +1202,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget mo->angle = FixedAngle((P_RandomKey(36)*10)<angle); + mo2->angle = mo->angle; P_SetMobjState(mo2, S_BOSSSEBH2); if (++i == 2) // we've already removed 2 of these, let's stop now @@ -1346,7 +1346,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget for (i = 0; i < 2; i++) { mobj_t *blast = P_SpawnMobjFromMobj(target, 0, 0, target->info->height >> 1, MT_BATTLEBUMPER_BLAST); - P_InitAngle(blast, angle + i*ANGLE_90); + blast->angle = angle + i*ANGLE_90; P_SetScale(blast, 2*blast->scale/3); blast->destscale = 2*blast->scale; } @@ -1576,7 +1576,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_SPIKE);\ P_SetMobjState(chunk, target->info->xdeathstate);\ chunk->health = 0;\ - P_InitAngle(chunk, angtweak);\ + chunk->angle = angtweak;\ P_UnsetThingPosition(chunk);\ chunk->flags = MF_NOCLIP;\ chunk->x += xmov;\ @@ -1598,7 +1598,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_SPIKE); P_SetMobjState(chunk, target->info->deathstate); chunk->health = 0; - P_InitAngle(chunk, ang + ANGLE_180); + chunk->angle = ang + ANGLE_180; P_UnsetThingPosition(chunk); chunk->flags = MF_NOCLIP; chunk->x -= xoffs; @@ -1644,7 +1644,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_WALLSPIKE);\ P_SetMobjState(chunk, target->info->xdeathstate);\ chunk->health = 0;\ - P_InitAngle(chunk, target->angle);\ + chunk->angle = target->angle;\ P_UnsetThingPosition(chunk);\ chunk->flags = MF_NOCLIP;\ chunk->x += xmov - forwardxoffs;\ @@ -1670,7 +1670,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget P_SetMobjState(chunk, target->info->deathstate); chunk->health = 0; - P_InitAngle(chunk, target->angle); + chunk->angle = target->angle; P_UnsetThingPosition(chunk); chunk->flags = MF_NOCLIP; chunk->x += forwardxoffs - xoffs; @@ -1794,7 +1794,7 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source, boom = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FZEROBOOM); boom->scale = player->mo->scale; - P_InitAngle(boom, player->mo->angle); + boom->angle = player->mo->angle; P_SetTarget(&boom->target, player->mo); } diff --git a/src/p_local.h b/src/p_local.h index 0e03b8482..c334643b0 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -416,9 +416,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff); boolean P_Move(mobj_t *actor, fixed_t speed); boolean P_SetOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z); boolean P_MoveOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z); -void P_InitAngle(mobj_t *thing, angle_t newValue); -void P_InitPitch(mobj_t *thing, angle_t newValue); -void P_InitRoll(mobj_t *thing, angle_t newValue); void P_SlideMove(mobj_t *mo); void P_BouncePlayerMove(mobj_t *mo); void P_BounceMove(mobj_t *mo); diff --git a/src/p_map.c b/src/p_map.c index 3d6938ed2..928d9009b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -158,31 +158,6 @@ boolean P_MoveOrigin(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z) return P_TeleportMove(thing, x, y, z); } -// -// P_InitAngle - Change an object's angle, including interp values. -// -void P_InitAngle(mobj_t *thing, angle_t newValue) -{ - thing->angle = thing->old_angle = newValue; -} - -// -// P_InitPitch - Change an object's pitch, including interp values. -// -void P_InitPitch(mobj_t *thing, angle_t newValue) -{ - thing->pitch = thing->old_pitch = newValue; -} - -// -// P_InitRoll - Change an object's roll, including interp values. -// -void P_InitRoll(mobj_t *thing, angle_t newValue) -{ - thing->roll = thing->old_roll = newValue; -} - - // ========================================================================= // MOVEMENT ITERATOR FUNCTIONS // ========================================================================= @@ -432,7 +407,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) mobj_t *grease; grease = P_SpawnMobj(object->x, object->y, object->z, MT_TIREGREASE); P_SetTarget(&grease->target, object); - P_InitAngle(grease, K_MomentumAngle(object)); + grease->angle = K_MomentumAngle(object); grease->extravalue1 = i; } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 4731094e1..f55f4e24e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2412,7 +2412,7 @@ boolean P_ZMovement(mobj_t *mo) MT_KART_TIRE ); - P_InitAngle(tire, mo->angle); + tire->angle = mo->angle; tire->fuse = 3*TICRATE; P_InstaThrust(tire, tireAngle, 4 * mo->scale); P_SetObjectMomZ(tire, 4*FRACUNIT, false); @@ -2432,7 +2432,7 @@ boolean P_ZMovement(mobj_t *mo) MT_KART_TIRE ); - P_InitAngle(tire, mo->angle); + tire->angle = mo->angle; tire->fuse = 3*TICRATE; P_InstaThrust(tire, tireAngle, 4 * mo->scale); P_SetObjectMomZ(tire, 4*FRACUNIT, false); @@ -4201,7 +4201,7 @@ static void P_SpawnItemCapsuleParts(mobj_t *mobj) part = part->hnext; P_SetTarget(&part->target, mobj); P_SetMobjState(part, buttState); - P_InitAngle(part, i * ANG_CAPSULE); + part->angle = i * ANG_CAPSULE; part->movedir = spin; // rotation speed part->movefactor = 0; // z offset part->extravalue1 = buttScale; // relative scale @@ -4212,7 +4212,7 @@ static void P_SpawnItemCapsuleParts(mobj_t *mobj) part = part->hnext; P_SetTarget(&part->target, mobj); P_SetMobjState(part, S_ITEMCAPSULE_TOP_SIDE); - P_InitAngle(part, i * ANG_CAPSULE); + part->angle = i * ANG_CAPSULE; part->movedir = spin; // rotation speed part->movefactor = mobj->info->height - part->info->height; // z offset } @@ -4540,7 +4540,7 @@ void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 numb mobj->z -= mobj->height>>1; // change angle - P_InitAngle(mobj, R_PointToAngle2(mobj->x, mobj->y, x, y)); + mobj->angle = R_PointToAngle2(mobj->x, mobj->y, x, y); // change slope dist = P_AproxDistance(P_AproxDistance(x - mobj->x, y - mobj->y), z - mobj->z); @@ -5229,7 +5229,7 @@ static void P_FlameJetSceneryThink(mobj_t *mobj) flame = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_FLAMEJETFLAME); P_SetMobjState(flame, S_FLAMEJETFLAME4); - P_InitAngle(flame, mobj->angle); + flame->angle = mobj->angle; if (mobj->flags2 & MF2_AMBUSH) // Wave up and down instead of side-to-side flame->momz = mobj->fuse << (FRACBITS - 2); @@ -5718,7 +5718,7 @@ static void P_MobjSceneryThink(mobj_t *mobj) blast->angle += ANGLE_90; S_StartSound(blast, sfx_cdfm64); } - P_InitAngle(blast, blast->angle); + blast->angle = blast->angle; blast->destscale *= 4; } @@ -5863,7 +5863,7 @@ static void P_MobjSceneryThink(mobj_t *mobj) mobj->x = mobj->target->x; mobj->y = mobj->target->y; - P_InitAngle (mobj, R_PointToAngle(mobj->x, mobj->y) + ANGLE_90); // literally only happened because i wanted to ^L^R the SPR_ITEM's + mobj->angle = R_PointToAngle(mobj->x, mobj->y) + ANGLE_90; // literally only happened because i wanted to ^L^R the SPR_ITEM's if (!r_splitscreen && players[displayplayers[0]].mo) { @@ -7668,7 +7668,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->z + (mobj->height/2) + (P_RandomRange(-20,20) * mobj->scale), MT_FASTLINE); - P_InitAngle(fast, mobj->angle); + fast->angle = mobj->angle; fast->momx = 3*mobj->target->momx/4; fast->momy = 3*mobj->target->momy/4; fast->momz = 3*P_GetMobjZMovement(mobj->target)/4; @@ -7730,7 +7730,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (underlayst != S_NULL) { mobj_t *underlay = P_SpawnMobj(mobj->target->x, mobj->target->y, mobj->target->z, MT_FLAMESHIELDUNDERLAY); - P_InitAngle(underlay, mobj->angle); + underlay->angle = mobj->angle; P_SetMobjState(underlay, underlayst); } break; @@ -9156,7 +9156,7 @@ static boolean P_FuseThink(mobj_t *mobj) for (i = 0; i < 5; i++) { mobj_t *debris = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_SMK_ICEBLOCK_DEBRIS); - P_InitAngle(debris, FixedAngle(P_RandomRange(0,360)<angle = FixedAngle(P_RandomRange(0,360)<angle, P_RandomRange(3,18)*(FRACUNIT/4)); debris->momz = P_RandomRange(4,8)<angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270)); + bigmeatyclaw->angle = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270); P_SetTarget(&mobj->tracer, bigmeatyclaw); P_SetTarget(&bigmeatyclaw->tracer, mobj); mobj->reactiontime >>= 1; @@ -9973,7 +9973,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_BANPYURA: { mobj_t *bigmeatyclaw = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_BANPSPRING); - P_InitAngle(bigmeatyclaw, mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270)); + bigmeatyclaw->angle = mobj->angle + ((mobj->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270); P_SetTarget(&mobj->tracer, bigmeatyclaw); P_SetTarget(&bigmeatyclaw->tracer, mobj); mobj->reactiontime >>= 1; @@ -10109,7 +10109,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) break; case MT_MINECARTEND: P_SetTarget(&mobj->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_MINECARTENDSOLID)); - P_InitAngle(mobj->tracer, mobj->angle + ANGLE_90); + mobj->tracer->angle = mobj->angle + ANGLE_90; break; case MT_TORCHFLOWER: { @@ -10231,7 +10231,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) angle_t ang = i * diff; mobj_t *side = P_SpawnMobj(mobj->x + FINECOSINE((ang>>ANGLETOFINESHIFT) & FINEMASK), mobj->y + FINESINE((ang>>ANGLETOFINESHIFT) & FINEMASK), mobj->z, MT_DAYTONAPINETREE_SIDE); - P_InitAngle(side, ang); + side->angle = ang; side->target = mobj; side->threshold = i; } @@ -10248,7 +10248,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) cur = P_SpawnMobj(mobj->x + FINECOSINE(((mobj->angle*8)>>ANGLETOFINESHIFT) & FINEMASK), mobj->y + FINESINE(((mobj->angle*8)>>ANGLETOFINESHIFT) & FINEMASK), mobj->z, MT_EZZPROPELLER_BLADE); - P_InitAngle(cur, mobj->angle); + cur->angle = mobj->angle; P_SetTarget(&cur->hprev, prev); P_SetTarget(&prev->hnext, cur); @@ -10314,7 +10314,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) cur->threshold = i; P_MoveOrigin(cur, cur->x + ((cur->radius>>FRACBITS) * FINECOSINE((FixedAngle((90*cur->threshold)<>ANGLETOFINESHIFT) & FINEMASK)), cur->y + ((cur->radius>>FRACBITS) * FINESINE((FixedAngle((90*cur->threshold)<>ANGLETOFINESHIFT) & FINEMASK)), cur->z); - P_InitAngle(cur, ANGLE_90*(cur->threshold+1)); + cur->angle = ANGLE_90*(cur->threshold+1); P_SetTarget(&cur->hprev, prev); P_SetTarget(&prev->hnext, cur); @@ -11849,7 +11849,7 @@ static boolean P_SetupMace(mapthing_t *mthing, mobj_t *mobj, boolean *doangle) spawnee->friction = mroll;\ spawnee->movefactor = mwidthset;\ spawnee->movecount = dist;\ - P_InitAngle(spawnee, myaw);\ + spawnee->angle = myaw;\ spawnee->flags |= (MF_NOGRAVITY|mflagsapply);\ spawnee->flags2 |= (mflags2apply|moreflags2);\ spawnee->eflags |= meflagsapply;\ @@ -12048,29 +12048,29 @@ static boolean P_SetupBooster(mapthing_t* mthing, mobj_t* mobj, boolean strong) statenum_t rollerstate = strong ? S_REDBOOSTERROLLER : S_YELLOWBOOSTERROLLER; mobj_t *seg = P_SpawnMobjFromMobj(mobj, 26*x1, 26*y1, 0, MT_BOOSTERSEG); - P_InitAngle(seg, angle - ANGLE_90); + seg->angle = angle - ANGLE_90; P_SetMobjState(seg, facestate); seg = P_SpawnMobjFromMobj(mobj, -26*x1, -26*y1, 0, MT_BOOSTERSEG); - P_InitAngle(seg, angle + ANGLE_90); + seg->angle = angle + ANGLE_90; P_SetMobjState(seg, facestate); seg = P_SpawnMobjFromMobj(mobj, 21*x2, 21*y2, 0, MT_BOOSTERSEG); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, leftstate); seg = P_SpawnMobjFromMobj(mobj, -21*x2, -21*y2, 0, MT_BOOSTERSEG); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, rightstate); seg = P_SpawnMobjFromMobj(mobj, 13*(x1 + x2), 13*(y1 + y2), 0, MT_BOOSTERROLLER); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, rollerstate); seg = P_SpawnMobjFromMobj(mobj, 13*(x1 - x2), 13*(y1 - y2), 0, MT_BOOSTERROLLER); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, rollerstate); seg = P_SpawnMobjFromMobj(mobj, -13*(x1 + x2), -13*(y1 + y2), 0, MT_BOOSTERROLLER); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, rollerstate); seg = P_SpawnMobjFromMobj(mobj, -13*(x1 - x2), -13*(y1 - y2), 0, MT_BOOSTERROLLER); - P_InitAngle(seg, angle); + seg->angle = angle; P_SetMobjState(seg, rollerstate); return true; @@ -12247,19 +12247,19 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean case MT_THZTREE: { // Spawn the branches angle_t mobjangle = FixedAngle((mthing->angle % 113) << FRACBITS); - P_InitAngle(P_SpawnMobjFromMobj(mobj, FRACUNIT, 0, 0, MT_THZTREEBRANCH), mobjangle + ANGLE_22h); - P_InitAngle(P_SpawnMobjFromMobj(mobj, 0, FRACUNIT, 0, MT_THZTREEBRANCH), mobjangle + ANGLE_157h); - P_InitAngle(P_SpawnMobjFromMobj(mobj, -FRACUNIT, 0, 0, MT_THZTREEBRANCH), mobjangle + ANGLE_270); + P_SpawnMobjFromMobj(mobj, FRACUNIT, 0, 0, MT_THZTREEBRANCH)->angle = mobjangle + ANGLE_22h; + P_SpawnMobjFromMobj(mobj, 0, FRACUNIT, 0, MT_THZTREEBRANCH)->angle = mobjangle + ANGLE_157h; + P_SpawnMobjFromMobj(mobj, -FRACUNIT, 0, 0, MT_THZTREEBRANCH)->angle = mobjangle + ANGLE_270; } break; case MT_CEZPOLE1: case MT_CEZPOLE2: { // Spawn the banner angle_t mobjangle = FixedAngle(mthing->angle << FRACBITS); - P_InitAngle(P_SpawnMobjFromMobj(mobj, + P_SpawnMobjFromMobj(mobj, P_ReturnThrustX(mobj, mobjangle, 4 << FRACBITS), P_ReturnThrustY(mobj, mobjangle, 4 << FRACBITS), - 0, ((mobj->type == MT_CEZPOLE1) ? MT_CEZBANNER1 : MT_CEZBANNER2)), mobjangle + ANGLE_90); + 0, ((mobj->type == MT_CEZPOLE1) ? MT_CEZBANNER1 : MT_CEZBANNER2))->angle = mobjangle + ANGLE_90; } break; case MT_HHZTREE_TOP: @@ -12268,7 +12268,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean mobj_t* leaf; #define doleaf(x, y) \ leaf = P_SpawnMobjFromMobj(mobj, x, y, 0, MT_HHZTREE_PART);\ - P_InitAngle(leaf, mobjangle);\ + leaf->angle = mobjangle;\ P_SetMobjState(leaf, leaf->info->seestate);\ mobjangle += ANGLE_90 doleaf(FRACUNIT, 0); @@ -12292,7 +12292,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean fixed_t xoffs = FINECOSINE(fa); fixed_t yoffs = FINESINE(fa); mobj_t* leaf = P_SpawnMobjFromMobj(mobj, xoffs, yoffs, 0, MT_BIGFERNLEAF); - P_InitAngle(leaf, angle); + leaf->angle = angle; angle += ANGLE_45; } break; @@ -12402,7 +12402,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean mobj->x - P_ReturnThrustX(mobj, mobjangle, baseradius), mobj->y - P_ReturnThrustY(mobj, mobjangle, baseradius), mobj->z, MT_WALLSPIKEBASE); - P_InitAngle(base, mobjangle + ANGLE_90); + base->angle = mobjangle + ANGLE_90; base->destscale = mobj->destscale; P_SetScale(base, mobj->scale); P_SetTarget(&base->target, mobj); @@ -12608,7 +12608,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean leaf = P_SpawnMobj(mobj->x + FINECOSINE((mobj->angle>>ANGLETOFINESHIFT) & FINEMASK), mobj->y + FINESINE((mobj->angle>>ANGLETOFINESHIFT) & FINEMASK), top, MT_AAZTREE_LEAF); - P_InitAngle(leaf, mobj->angle); + leaf->angle = mobj->angle; // Small coconut for each leaf P_SpawnMobj(mobj->x + (32 * FINECOSINE((mobj->angle>>ANGLETOFINESHIFT) & FINEMASK)), @@ -12826,7 +12826,7 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, if (doangle) { - P_InitAngle(mobj, FixedAngle(mthing->angle << FRACBITS)); + mobj->angle = FixedAngle(mthing->angle << FRACBITS); } if ((mobj->flags & MF_SPRING) @@ -12839,8 +12839,8 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, mobj->spryoff = FixedMul(mobj->radius, FINESINE(a >> ANGLETOFINESHIFT)); } - P_InitPitch(mobj, FixedAngle(mthing->pitch << FRACBITS)); - P_InitRoll(mobj, FixedAngle(mthing->roll << FRACBITS)); + mobj->pitch = FixedAngle(mthing->pitch << FRACBITS); + mobj->roll = FixedAngle(mthing->roll << FRACBITS); mthing->mobj = mobj; @@ -13247,7 +13247,7 @@ mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, P_SetTarget(&th->target, source); // where it came from an = R_PointToAngle2(x, y, dest->x, dest->y); - P_InitAngle(th, an); + th->angle = an; an >>= ANGLETOFINESHIFT; th->momx = FixedMul(speed, FINECOSINE(an)); th->momy = FixedMul(speed, FINESINE(an)); @@ -13309,7 +13309,7 @@ mobj_t *P_SpawnAlteredDirectionMissile(mobj_t *source, mobjtype_t type, fixed_t P_SetTarget(&th->target, source->target); // where it came from an = R_PointToAngle2(0, 0, source->momx, source->momy) + (ANG1*shiftingAngle); - P_InitAngle(th, an); + th->angle = an; an >>= ANGLETOFINESHIFT; th->momx = FixedMul(speed, FINECOSINE(an)); th->momy = FixedMul(speed, FINESINE(an)); @@ -13374,7 +13374,7 @@ mobj_t *P_SpawnPointMissile(mobj_t *source, fixed_t xa, fixed_t ya, fixed_t za, P_SetTarget(&th->target, source); // where it came from an = R_PointToAngle2(x, y, xa, ya); - P_InitAngle(th, an); + th->angle = an; an >>= ANGLETOFINESHIFT; th->momx = FixedMul(speed, FINECOSINE(an)); th->momy = FixedMul(speed, FINESINE(an)); @@ -13453,7 +13453,7 @@ mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type) else an = R_PointToAngle2(source->x, source->y, dest->x, dest->y); - P_InitAngle(th, an); + th->angle = an; an >>= ANGLETOFINESHIFT; th->momx = FixedMul(speed, FINECOSINE(an)); th->momy = FixedMul(speed, FINESINE(an)); @@ -13541,7 +13541,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai speed = th->info->speed; - P_InitAngle(th, an); + th->angle = an; th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT)); th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT)); diff --git a/src/p_spec.c b/src/p_spec.c index 6d437fa08..2392c1a46 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3711,7 +3711,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (mobj) { if (line->flags & ML_EFFECT1) - P_InitAngle(mobj, R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y)); + mobj->angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y); CONS_Debug(DBG_GAMELOGIC, "Linedef Type %d - Spawn Object: %d spawned at (%d, %d, %d)\n", line->special, mobj->type, mobj->x>>FRACBITS, mobj->y>>FRACBITS, mobj->z>>FRACBITS); //TODO: Convert mobj->type to a string somehow. } else @@ -4005,7 +4005,7 @@ void P_SetupSignExit(player_t *player) if (player->mo && !P_MobjWasRemoved(player->mo)) { thing = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->floorz, MT_SIGN); - P_InitAngle(thing, player->mo->angle); + thing->angle = player->mo->angle; P_SetupSignObject(thing, player->mo, true); // Use :youfuckedup: sign face } } diff --git a/src/p_telept.c b/src/p_telept.c index 59774dd76..768a2d958 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -97,7 +97,8 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, P_FlashPal(thing->player, PAL_MIXUP, 10); } - P_InitAngle(thing, angle); + thing->old_angle += (angle-thing->angle); + thing->angle = angle; thing->momx = thing->momy = thing->momz = 0; diff --git a/src/p_user.c b/src/p_user.c index ec4d540c1..fa23a570a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -384,7 +384,7 @@ void P_GiveFinishFlags(player_t *player) fixed_t xoffs = FINECOSINE(fa); fixed_t yoffs = FINESINE(fa); mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); - P_InitAngle(flag, angle); + flag->angle = angle; angle += FixedAngle(120*FRACUNIT); P_SetTarget(&flag->target, player->mo); @@ -2289,7 +2289,7 @@ void P_MovePlayer(player_t *player) // underlay water = P_SpawnMobj(x1, y1, ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY); - P_InitAngle(water, forwardangle - ANGLE_180 - ANGLE_22h); + water->angle = forwardangle - ANGLE_180 - ANGLE_22h; water->destscale = trailScale; water->momx = player->mo->momx; water->momy = player->mo->momy; @@ -2300,7 +2300,7 @@ void P_MovePlayer(player_t *player) // overlay water = P_SpawnMobj(x1, y1, ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL); - P_InitAngle(water, forwardangle - ANGLE_180 - ANGLE_22h); + water->angle = forwardangle - ANGLE_180 - ANGLE_22h; water->destscale = trailScale; water->momx = player->mo->momx; water->momy = player->mo->momy; @@ -2312,7 +2312,7 @@ void P_MovePlayer(player_t *player) // Underlay water = P_SpawnMobj(x2, y2, ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY); - P_InitAngle(water, forwardangle - ANGLE_180 + ANGLE_22h); + water->angle = forwardangle - ANGLE_180 + ANGLE_22h; water->destscale = trailScale; water->momx = player->mo->momx; water->momy = player->mo->momy; @@ -2323,7 +2323,7 @@ void P_MovePlayer(player_t *player) // Overlay water = P_SpawnMobj(x2, y2, ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL); - P_InitAngle(water, forwardangle - ANGLE_180 + ANGLE_22h); + water->angle = forwardangle - ANGLE_180 + ANGLE_22h; water->destscale = trailScale; water->momx = player->mo->momx; water->momy = player->mo->momy; From d962803440d3354de3c7160856d26c1630a98c95 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 25 Aug 2022 16:56:40 +0100 Subject: [PATCH 03/26] Commit unstaged hyudoro fix --- src/objects/hyudoro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 0a362aa89..9134a8c73 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -405,7 +405,7 @@ Obj_HyudoroDeploy (mobj_t *master) center->radius = hyu->radius; - P_InitAngle(hyu, master->angle); + hyu->angle = hyu->old_angle = master->angle; P_SetTarget(&hyudoro_center(hyu), center); P_SetTarget(&hyudoro_center_master(center), master); From d7be3d3aca6750b9ded5368a80784550747ce611 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 27 Sep 2022 22:43:45 -0400 Subject: [PATCH 04/26] Add Duel objects - Banana, Eggman Items, Proxi Mine, Land Mine, Hyudoro, and Drop Targets are now placeable in maps. - By default, will only appear when in 1v1s. (Extra flag can be checked to enable spawning in all modes.) - Most of these objects will need tweaks to account for being placeable now. --- extras/conf/D3R-Config.cfg | 55 +++++++++++++++++++++++++++++++++++++- src/doomstat.h | 1 + src/g_game.c | 1 + src/info.c | 12 ++++----- src/k_kart.c | 3 +++ src/p_mobj.c | 15 +++++++++++ src/p_saveg.c | 2 ++ 7 files changed, 82 insertions(+), 7 deletions(-) diff --git a/extras/conf/D3R-Config.cfg b/extras/conf/D3R-Config.cfg index 0482dc439..7db8d8d99 100644 --- a/extras/conf/D3R-Config.cfg +++ b/extras/conf/D3R-Config.cfg @@ -139,7 +139,7 @@ skins // Gametypes gametypes { - -1 = "Single Player"; + -1 = "Grand Prix"; 0 = "Race"; 1 = "Battle"; } @@ -5113,6 +5113,7 @@ thingtypes height = 92; } } + waypoints { color = 4; // Red @@ -5161,6 +5162,58 @@ thingtypes fixedrotation = 1; } } + + duel + { + color = 4; // Red + arrow = 1; + title = "Duel-Only"; + sprite = "SPBMA2A8"; + width = 16; + height = 32; + flags1text = "[1] Spawn in all modes"; + + 2050 + { + title = "Duel Bomb"; + } + + 2051 + { + title = "Banana"; + sprite = "BANAA2A8"; + } + + 2052 + { + title = "Eggman Item"; + sprite = "FITMA0"; + } + + 2053 + { + title = "Proximity Mine"; + sprite = "SSMNA0"; + } + + 2054 + { + title = "Land Mine"; + sprite = "LNDMA0"; + } + + 2055 + { + title = "Hyudoro"; + sprite = "HYUUA2A8"; + } + + 2056 + { + title = "Drop Target"; + sprite = "DTRGA0"; + } + } } //Default things filters diff --git a/src/doomstat.h b/src/doomstat.h index dc6370ece..dc94ed0e6 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -669,6 +669,7 @@ extern boolean thwompsactive; extern UINT8 lastLowestLap; extern SINT8 spbplace; extern boolean rainbowstartavailable; +extern boolean inDuel; extern tic_t bombflashtimer; // Used to avoid causing seizures if multiple mines explode close to you :) extern boolean legitimateexit; diff --git a/src/g_game.c b/src/g_game.c index 181aa0697..3e6d3108d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -312,6 +312,7 @@ boolean thwompsactive; // Thwomps activate on lap 2 UINT8 lastLowestLap; // Last lowest lap, for activating race lap executors SINT8 spbplace; // SPB exists, give the person behind better items boolean rainbowstartavailable; // Boolean, keeps track of if the rainbow start was gotten +boolean inDuel; // Boolean, keeps track of if it is a 1v1 // Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players) tic_t bombflashtimer = 0; // Cooldown before another FlashPal can be intialized by a bomb exploding near a displayplayer. Avoids seizures. diff --git a/src/info.c b/src/info.c index a5fe03bf2..1d95ad000 100644 --- a/src/info.c +++ b/src/info.c @@ -23310,7 +23310,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_EGGMANITEM - -1, // doomednum + 2052, // doomednum S_EGGMANITEM1, // spawnstate 2, // spawnhealth S_NULL, // seestate @@ -23364,7 +23364,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BANANA - -1, // doomednum + 2051, // doomednum S_BANANA, // spawnstate 2, // spawnhealth S_NULL, // seestate @@ -23553,7 +23553,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SSMINE - -1, // doomednum + 2053, // doomednum S_SSMINE_AIR1, // spawnstate 1, // spawnhealth S_NULL, // seestate @@ -23688,7 +23688,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_LANDMINE - -1, // doomednum + 2054, // doomednum S_LANDMINE, // spawnstate 2, // spawnhealth S_NULL, // seestate @@ -23715,7 +23715,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_DROPTARGET - -1, // doomednum + 2056, // doomednum S_DROPTARGET, // spawnstate 3, // spawnhealth S_NULL, // seestate @@ -24066,7 +24066,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_HYUDORO - -1, // doomednum + 2055, // doomednum S_HYUDORO, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/k_kart.c b/src/k_kart.c index 5aa1aaeba..0b391d94d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -78,6 +78,9 @@ void K_TimerInit(void) numPlayers++; } + // 1v1 activates DUEL rules! + inDuel = (numPlayers == 2); + if (numPlayers >= 2) { rainbowstartavailable = true; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9b08f0e75..4006d399d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11548,6 +11548,21 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) return false; } break; + //case MT_DUELBOMB: + case MT_BANANA: + case MT_EGGMANITEM: + case MT_SSMINE: + case MT_LANDMINE: + case MT_HYUDORO: + case MT_DROPTARGET: + { + // Duel objects. + // Normally only spawn when placed by the map in Duels, + // but can be forced to always spawn with the Extra flag. + if (inDuel == false && !(mthing->options & MTF_EXTRA)) + return false; + } + break; default: break; } diff --git a/src/p_saveg.c b/src/p_saveg.c index 233056f21..d050da4b1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -4576,6 +4576,7 @@ static void P_NetArchiveMisc(boolean resending) WRITEUINT8(save_p, lastLowestLap); WRITESINT8(save_p, spbplace); WRITEUINT8(save_p, rainbowstartavailable); + WRITEUINT8(save_p, inDuel); WRITEUINT32(save_p, introtime); WRITEUINT32(save_p, starttime); @@ -4733,6 +4734,7 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading) lastLowestLap = READUINT8(save_p); spbplace = READSINT8(save_p); rainbowstartavailable = (boolean)READUINT8(save_p); + inDuel = (boolean)READUINT8(save_p); introtime = READUINT32(save_p); starttime = READUINT32(save_p); From aa7c7df27cd197dd869d1477157be737ac4adff1 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 27 Sep 2022 22:55:35 -0400 Subject: [PATCH 05/26] Give Landmines a default color --- src/p_mobj.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 4006d399d..cf8856301 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6843,6 +6843,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj) case MT_LANDMINE: mobj->friction = ORIG_FRICTION/4; + if (mobj->target && mobj->target->player) + mobj->color = mobj->target->player->skincolor; + else + mobj->color = SKINCOLOR_SAPPHIRE; + if (mobj->momx || mobj->momy || mobj->momz) { mobj_t *ghost = P_SpawnGhostMobj(mobj); From c22d652add2c6aafa486c40750d6cae94d84cf97 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 27 Sep 2022 23:04:38 -0400 Subject: [PATCH 06/26] Give map-placed bananas a random angle --- src/p_mobj.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index cf8856301..ef97d82b6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12734,6 +12734,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean // Increment no. of capsules on the map counter maptargets++; + break; + } + case MT_BANANA: + { + // Give Duel bananas a random angle + mobj->angle = FixedMul(P_RandomFixed(PR_DECORATION), ANGLE_MAX); + *doangle = false; + break; } default: break; From 456c824abfbff0fae911a05dbdbbb47f38354d90 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 27 Sep 2022 23:29:06 -0400 Subject: [PATCH 07/26] Init Hyudoro center properly --- src/info.c | 4 ++-- src/k_objects.h | 1 + src/objects/hyudoro.c | 19 +++++++++++++------ src/p_mobj.c | 7 ++++++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/info.c b/src/info.c index 1d95ad000..dd93bf376 100644 --- a/src/info.c +++ b/src/info.c @@ -24066,7 +24066,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_HYUDORO - 2055, // doomednum + -1, // doomednum S_HYUDORO, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -24093,7 +24093,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_HYUDORO_CENTER - -1, // doomednum + 2055, // doomednum S_INVISIBLE, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/k_objects.h b/src/k_objects.h index 7679db658..7351465d6 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -3,6 +3,7 @@ #define k_objects_H /* Hyudoro */ +void Obj_InitHyudoroCenter(mobj_t *center, mobj_t *master); void Obj_HyudoroDeploy(mobj_t *master); void Obj_HyudoroThink(mobj_t *actor); void Obj_HyudoroCenterThink(mobj_t *actor); diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 0a362aa89..c1a2e60a8 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -388,11 +388,8 @@ hyudoro_hover_await_stack (mobj_t *hyu) } void -Obj_HyudoroDeploy (mobj_t *master) +Obj_InitHyudoroCenter (mobj_t * center, mobj_t * master) { - mobj_t *center = P_SpawnMobjFromMobj( - master, 0, 0, 0, MT_HYUDORO_CENTER); - mobj_t *hyu = P_SpawnMobjFromMobj( center, 0, 0, 0, MT_HYUDORO); @@ -405,20 +402,30 @@ Obj_HyudoroDeploy (mobj_t *master) center->radius = hyu->radius; - P_InitAngle(hyu, master->angle); + P_InitAngle(hyu, center->angle); P_SetTarget(&hyudoro_center(hyu), center); P_SetTarget(&hyudoro_center_master(center), master); hyudoro_mode(hyu) = HYU_PATROL; // Set splitscreen player visibility - if (master->player) + if (master && !P_MobjWasRemoved(master) && master->player) { hyu->renderflags |= RF_DONTDRAW & ~(K_GetPlayerDontDrawFlag(master->player)); } spawn_hyudoro_shadow(hyu); // this sucks btw +} + +void +Obj_HyudoroDeploy (mobj_t *master) +{ + mobj_t *center = P_SpawnMobjFromMobj( + master, 0, 0, 0, MT_HYUDORO_CENTER); + + center->angle = master->angle; + Obj_InitHyudoroCenter(center, master); S_StartSound(master, sfx_s3k92); // scary ghost noise } diff --git a/src/p_mobj.c b/src/p_mobj.c index ef97d82b6..ad280040c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11558,7 +11558,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) case MT_EGGMANITEM: case MT_SSMINE: case MT_LANDMINE: - case MT_HYUDORO: + case MT_HYUDORO_CENTER: case MT_DROPTARGET: { // Duel objects. @@ -12743,6 +12743,11 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean *doangle = false; break; } + case MT_HYUDORO_CENTER: + { + Obj_InitHyudoroCenter(mobj, NULL); + break; + } default: break; } From 13a77581c44c8862eb44f98679bc17deafec514f Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 00:44:50 -0400 Subject: [PATCH 08/26] Hyudoro behaves properly without owner set When it's placed by the level, it's given to whoever has the best position at time of stealing. Since this is meant for duels, this means always the other player. This behavior is also used as a default whenever its owner gets unset for whatever reason. If there is literally NO ONE (1P), then rotate in place violently. --- src/objects/hyudoro.c | 116 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 4 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index c1a2e60a8..3c804cdfc 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -1,3 +1,15 @@ +// DR. ROBOTNIK'S RING RACERS +//----------------------------------------------------------------------------- +// Copyright (C) 2022 by James R. +// Copyright (C) 2022 by Kart Krew +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file hyudoro.c +/// \brief Hyudoro item code. + #include "../doomdef.h" #include "../doomstat.h" #include "../info.h" @@ -7,6 +19,7 @@ #include "../p_local.h" #include "../r_main.h" #include "../s_sound.h" +#include "../g_game.h" enum { HYU_PATROL, @@ -39,11 +52,14 @@ K_ChangePlayerItem #define hyudoro_hover_stack(o) ((o)->threshold) #define hyudoro_next(o) ((o)->tracer) #define hyudoro_stackpos(o) ((o)->reactiontime) +#define hyudoro_delivered(o) (hyudoro_itemtype(o) == KITEM_NONE) // cannot be combined #define hyudoro_center(o) ((o)->target) #define hyudoro_target(o) ((o)->target) +#define hyudoro_stolefrom(o) ((o)->hnext) + #define hyudoro_center_max_radius(o) ((o)->threshold) #define hyudoro_center_master(o) ((o)->target) @@ -173,6 +189,82 @@ spawn_hyudoro_shadow (mobj_t *hyu) P_SetTarget(&shadow->tracer, hyu); } +static mobj_t * +find_duel_target (mobj_t *ignore) +{ + mobj_t *ret = NULL; + UINT8 bestPosition = UINT8_MAX; + UINT8 i; + + for (i = 0; i < MAXPLAYERS; i++) + { + player_t *player = NULL; + + if (playeringame[i] == false) + { + continue; + } + + player = &players[i]; + if (player->spectator || player->exiting) + { + continue; + } + + if (!player->mo || P_MobjWasRemoved(player->mo)) + { + continue; + } + + if (ignore != NULL && player->mo == ignore) + { + continue; + } + + if (player->position < bestPosition) + { + ret = player->mo; + bestPosition = player->position; + + if (bestPosition <= 1) + { + // Can't get any lower + break; + } + } + } + + return ret; +} + +static void +do_confused (mobj_t *hyu) +{ + // Hyudoro is confused. + // Spin around, try to find a new target. + const INT32 bob_speed = 32; + + if (hyudoro_delivered(hyu)) + { + // Already delivered, not confused + return; + } + + // Try to find new target + P_SetTarget(&hyudoro_target(hyu), + find_duel_target(hyudoro_stolefrom(hyu))); + + // Spin in circles + hyu->angle += ANGLE_45; + + // Bob very fast + sine_bob(hyu, + (leveltime & (bob_speed - 1)) * + (ANGLE_MAX / bob_speed), -(3*FRACUNIT/4)); + + hyu->sprzoff += hyu->height; +} + static void move_to_player (mobj_t *hyu) { @@ -181,8 +273,11 @@ move_to_player (mobj_t *hyu) angle_t angle; fixed_t speed; - if (!target) + if (!target || P_MobjWasRemoved(target)) + { + do_confused(hyu); return; + } angle = R_PointToAngle2( hyu->x, hyu->y, target->x, target->y); @@ -232,6 +327,9 @@ deliver_item (mobj_t *hyu) hyu->destscale = target->scale / 4; hyu->scalespeed = abs(hyu->scale - hyu->destscale) / hyu->tics; + + // sets as already delivered + hyudoro_itemtype(hyu) = KITEM_NONE; } static void @@ -287,11 +385,14 @@ hyudoro_patrol_hit_player mobj_t *center = hyudoro_center(hyu); + mobj_t *master = NULL; + if (!player) return false; // Cannot hit its master - if (toucher == get_hyudoro_master(hyu)) + master = get_hyudoro_master(hyu); + if (toucher == master) return false; // Don't punish a punished player @@ -313,8 +414,15 @@ hyudoro_patrol_hit_player player->hyudorotimer = hyudorotime; player->stealingtimer = hyudorotime; - P_SetTarget(&hyudoro_target(hyu), - hyudoro_center_master(center)); + P_SetTarget(&hyudoro_stolefrom(hyu), toucher); + + if (master == NULL || P_MobjWasRemoved(master)) + { + // if master is NULL, it is probably a DUEL + master = find_duel_target(toucher); + } + + P_SetTarget(&hyudoro_target(hyu), master); if (center) P_RemoveMobj(center); From f9c4f66931808a96b05d203eaf0905d51837f484 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 01:47:56 -0400 Subject: [PATCH 09/26] Add duel bomb objects Basically a landmine, but strafes back and forth. Currently uses SPB sprites, IDK if we'll end up replacing it later. --- extras/conf/D3R-Config.cfg | 51 ++++++++------------ src/deh_tables.c | 2 + src/info.c | 27 +++++++++++ src/info.h | 2 + src/k_botsearch.c | 1 + src/k_kart.c | 1 + src/k_objects.h | 6 +++ src/objects/Sourcefile | 1 + src/objects/duel-bomb.c | 98 ++++++++++++++++++++++++++++++++++++++ src/p_inter.c | 5 ++ src/p_mobj.c | 32 ++++++++++--- 11 files changed, 188 insertions(+), 38 deletions(-) create mode 100644 src/objects/duel-bomb.c diff --git a/extras/conf/D3R-Config.cfg b/extras/conf/D3R-Config.cfg index 7db8d8d99..862fb0cf3 100644 --- a/extras/conf/D3R-Config.cfg +++ b/extras/conf/D3R-Config.cfg @@ -5167,51 +5167,64 @@ thingtypes { color = 4; // Red arrow = 1; - title = "Duel-Only"; + title = "Duel Objects"; sprite = "SPBMA2A8"; - width = 16; - height = 32; + width = 24; + height = 48; flags1text = "[1] Spawn in all modes"; 2050 { title = "Duel Bomb"; + flags8text = "[8] Flip strafe"; } 2051 { title = "Banana"; sprite = "BANAA2A8"; + width = 16; + height = 32; } 2052 { title = "Eggman Item"; sprite = "FITMA0"; + width = 24; + height = 32; } 2053 { title = "Proximity Mine"; sprite = "SSMNA0"; + width = 16; + height = 24; } 2054 { title = "Land Mine"; - sprite = "LNDMA0"; + sprite = "LNDMALAR"; + width = 24; + height = 32; } 2055 { title = "Hyudoro"; sprite = "HYUUA2A8"; + width = 32; + height = 24; } 2056 { title = "Drop Target"; - sprite = "DTRGA0"; + sprite = "DTRGALAR"; + width = 45; + height = 32; } } } @@ -5236,24 +5249,6 @@ thingsfilters } filter2 - { - name = "Enemies"; - category = "enemies"; - type = -1; - - } - - - filter3 - { - name = "NiGHTS Track"; - category = "nightstrk"; - type = -1; - - } - - - filter4 { name = "Normal Gravity"; category = ""; @@ -5266,8 +5261,7 @@ thingsfilters } - - filter5 + filter3 { name = "Reverse Gravity"; category = ""; @@ -5279,11 +5273,4 @@ thingsfilters } } - - filter6 - { - name = "Boss Waypoints"; - category = ""; - type = 292; - } } diff --git a/src/deh_tables.c b/src/deh_tables.c index a0084ec85..a0d4e55bd 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5362,6 +5362,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_SINK_SHIELD", "MT_SINKTRAIL", + "MT_DUELBOMB", // Duel mode bombs + "MT_BATTLEBUMPER", // Battle Mode bumper "MT_BATTLEBUMPER_DEBRIS", "MT_BATTLEBUMPER_BLAST", diff --git a/src/info.c b/src/info.c index dd93bf376..b05a20abc 100644 --- a/src/info.c +++ b/src/info.c @@ -24362,6 +24362,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_DUELBOMB + 2050, // doomednum + S_SPB1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 64*FRACUNIT, // speed + 24*FRACUNIT, // radius + 48*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags + S_NULL // raisestate + }, + { // MT_BATTLEBUMPER -1, // doomednum S_BATTLEBUMPER1,// spawnstate diff --git a/src/info.h b/src/info.h index 29e2695bf..e40ea51ee 100644 --- a/src/info.h +++ b/src/info.h @@ -6408,6 +6408,8 @@ typedef enum mobj_type MT_SINK_SHIELD, MT_SINKTRAIL, + MT_DUELBOMB, // Duel mode bombs + MT_BATTLEBUMPER, // Battle Mode bumpers MT_BATTLEBUMPER_DEBRIS, MT_BATTLEBUMPER_BLAST, diff --git a/src/k_botsearch.c b/src/k_botsearch.c index 5b6f1ccca..48c5745fd 100644 --- a/src/k_botsearch.c +++ b/src/k_botsearch.c @@ -422,6 +422,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing) case MT_BALLHOG: case MT_SPB: case MT_BUBBLESHIELDTRAP: + case MT_DUELBOMB: K_AddDodgeObject(thing, side, 20); break; case MT_SHRINK_GUN: diff --git a/src/k_kart.c b/src/k_kart.c index 0b391d94d..44f7501fb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1419,6 +1419,7 @@ fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) break; case MT_ORBINAUT: case MT_ORBINAUT_SHIELD: + case MT_DUELBOMB: if (against->player) weight = K_PlayerWeight(against, NULL); break; diff --git a/src/k_objects.h b/src/k_objects.h index 7351465d6..be287c0f4 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -40,4 +40,10 @@ void Obj_OrbinautJawzMoveHeld(player_t *player); void Obj_JawzThink(mobj_t *th); void Obj_JawzThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir); +/* Duel Bomb */ +void Obj_DuelBombThink(mobj_t *bomb); +void Obj_DuelBombReverse(mobj_t *bomb); +void Obj_DuelBombTouch(mobj_t *bomb, mobj_t *toucher); +void Obj_DuelBombInit(mobj_t *bomb); + #endif/*k_objects_H*/ diff --git a/src/objects/Sourcefile b/src/objects/Sourcefile index 339175b0c..d768232c5 100644 --- a/src/objects/Sourcefile +++ b/src/objects/Sourcefile @@ -5,3 +5,4 @@ spb.c manta-ring.c orbinaut.c jawz.c +duel-bomb.c diff --git a/src/objects/duel-bomb.c b/src/objects/duel-bomb.c new file mode 100644 index 000000000..ace75f3b2 --- /dev/null +++ b/src/objects/duel-bomb.c @@ -0,0 +1,98 @@ +// DR. ROBOTNIK'S RING RACERS +//----------------------------------------------------------------------------- +// Copyright (C) 2022 by Sally "TehRealSalt" Cochenour +// Copyright (C) 2022 by Kart Krew +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file duel-bomb.c +/// \brief Duel mode bombs. + +#include "../doomdef.h" +#include "../doomstat.h" +#include "../info.h" +#include "../k_kart.h" +#include "../k_objects.h" +#include "../m_random.h" +#include "../p_local.h" +#include "../r_main.h" +#include "../s_sound.h" +#include "../g_game.h" +#include "../z_zone.h" +#include "../k_waypoint.h" +#include "../k_respawn.h" +#include "../k_collide.h" + +#define bomb_dir(o) ((o)->movedir) + +static fixed_t GetBombSpeed(mobj_t *bomb) +{ + return FixedMul(bomb->info->speed, bomb->scale); +} + +static void UpdateBombMovement(mobj_t *bomb) +{ + const fixed_t spd = GetBombSpeed(bomb); + bomb->momx = FixedMul(spd, FINECOSINE(bomb_dir(bomb) >> ANGLETOFINESHIFT)); + bomb->momy = FixedMul(spd, FINESINE(bomb_dir(bomb) >> ANGLETOFINESHIFT)); +} + +void Obj_DuelBombThink(mobj_t *bomb) +{ + boolean grounded = P_IsObjectOnGround(bomb); + + if (grounded == true) + { + UpdateBombMovement(bomb); + } +} + +void Obj_DuelBombReverse(mobj_t *bomb) +{ + bomb_dir(bomb) += ANGLE_180; + UpdateBombMovement(bomb); +} + +void Obj_DuelBombTouch(mobj_t *bomb, mobj_t *toucher) +{ + player_t *player = toucher->player; + mobj_t *boom = NULL; + + if (bomb->health <= 0 || toucher->health <= 0) + { + return; + } + + if (player->flashing > 0 || player->hyudorotimer > 0 || P_PlayerInPain(player)) + { + // No interaction + return; + } + + // Create explosion + boom = P_SpawnMobjFromMobj(bomb, 0, 0, 0, MT_BOOMEXPLODE); + boom->momz = 5 * boom->scale; + boom->color = SKINCOLOR_KETCHUP; + S_StartSound(boom, bomb->info->attacksound); + + // Kill bomb + P_KillMobj(bomb, toucher, toucher, DMG_NORMAL); + + if (player->invincibilitytimer > 0 + || K_IsBigger(toucher, bomb) == true + || player->flamedash > 0) + { + // Kill without damaging. + return; + } + + P_DamageMobj(toucher, bomb, bomb, 1, DMG_TUMBLE); +} + +void Obj_DuelBombInit(mobj_t *bomb) +{ + bomb_dir(bomb) = bomb->angle + ANGLE_90; + UpdateBombMovement(bomb); +} diff --git a/src/p_inter.c b/src/p_inter.c index 19f03c664..bbfa804be 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -356,6 +356,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) Obj_SPBTouch(special, toucher); return; } + case MT_DUELBOMB: + { + Obj_DuelBombTouch(special, toucher); + return; + } case MT_EMERALD: if (!P_CanPickupItem(player, 0)) return; diff --git a/src/p_mobj.c b/src/p_mobj.c index ad280040c..5b9ea4c75 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1720,7 +1720,8 @@ void P_XYMovement(mobj_t *mo) //{ SRB2kart - Orbinaut, Ballhog // Bump sparks - if (mo->type == MT_ORBINAUT || mo->type == MT_BALLHOG) + if (mo->type == MT_ORBINAUT || mo->type == MT_BALLHOG + || mo->type == MT_DUELBOMB) { mobj_t *fx; fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP); @@ -1754,13 +1755,17 @@ void P_XYMovement(mobj_t *mo) } break; + case MT_BUBBLESHIELDTRAP: + S_StartSound(mo, sfx_s3k44); // Bubble bounce + break; + + case MT_DUELBOMB: + Obj_DuelBombReverse(mo); + break; + default: break; } - - // Bubble bounce - if (mo->type == MT_BUBBLESHIELDTRAP) - S_StartSound(mo, sfx_s3k44); } } } @@ -2190,6 +2195,7 @@ boolean P_ZMovement(mobj_t *mo) case MT_LANDMINE: case MT_DROPTARGET: case MT_BUBBLESHIELDTRAP: + case MT_DUELBOMB: // Remove stuff from death pits. if (P_CheckDeathPitCollide(mo)) { @@ -6906,6 +6912,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj) case MT_SPBEXPLOSION: mobj->health--; break; + case MT_DUELBOMB: + { + Obj_DuelBombThink(mobj); + break; + } case MT_EMERALD: { if (battleovertime.enabled >= 10*TICRATE) @@ -9708,6 +9719,7 @@ static void P_DefaultMobjShadowScale(mobj_t *thing) case MT_SINK: case MT_ROCKETSNEAKER: case MT_SPB: + case MT_DUELBOMB: thing->shadowscale = 3*FRACUNIT/2; break; case MT_BANANA_SHIELD: @@ -10317,6 +10329,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Remove before release CONS_Alert(CONS_WARNING, "Boss waypoints are deprecated. Did you forget to remove the old checkpoints, too?\n"); break; + case MT_DUELBOMB: + Obj_DuelBombInit(mobj); + break; default: break; } @@ -11553,7 +11568,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) return false; } break; - //case MT_DUELBOMB: + case MT_DUELBOMB: case MT_BANANA: case MT_EGGMANITEM: case MT_SSMINE: @@ -12787,6 +12802,11 @@ static void P_SetAmbush(mobj_t *mobj) mobj->type != MT_NIGHTSBUMPER && mobj->type != MT_STARPOST) mobj->flags2 |= MF2_AMBUSH; + + if (mobj->type == MT_DUELBOMB) + { + Obj_DuelBombReverse(mobj); + } } static void P_SetObjectSpecial(mobj_t *mobj) From 1744da37915ac5a202ae981e5e1fc1b5aa4b8d63 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 01:56:58 -0400 Subject: [PATCH 10/26] Don't respawn items boxes in duels --- 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 bbfa804be..d9950aa89 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1017,7 +1017,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget { target->fuse = 2; } - else + else if (inDuel == false) { UINT8 i; From 0fb60afb97e1b9f4c88bc0b9a742e874889858a3 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 02:11:45 -0400 Subject: [PATCH 11/26] Make Duel Hyudoro invisible by default --- src/objects/hyudoro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 3c804cdfc..07147deca 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -517,10 +517,10 @@ Obj_InitHyudoroCenter (mobj_t * center, mobj_t * master) hyudoro_mode(hyu) = HYU_PATROL; // Set splitscreen player visibility + hyu->renderflags |= RF_DONTDRAW; if (master && !P_MobjWasRemoved(master) && master->player) { - hyu->renderflags |= RF_DONTDRAW & - ~(K_GetPlayerDontDrawFlag(master->player)); + hyu->renderflags &= ~(K_GetPlayerDontDrawFlag(master->player)); } spawn_hyudoro_shadow(hyu); // this sucks btw From 70a231f11595c9f605956bc2fe5192416c368132 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 02:37:01 -0400 Subject: [PATCH 12/26] Add Pogo Spring as a duel item --- extras/conf/D3R-Config.cfg | 15 ++++++++++++--- src/info.c | 2 +- src/p_mobj.c | 7 +++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/extras/conf/D3R-Config.cfg b/extras/conf/D3R-Config.cfg index 862fb0cf3..dac4b0135 100644 --- a/extras/conf/D3R-Config.cfg +++ b/extras/conf/D3R-Config.cfg @@ -5166,16 +5166,17 @@ thingtypes duel { color = 4; // Red - arrow = 1; + arrow = 0; title = "Duel Objects"; sprite = "SPBMA2A8"; - width = 24; - height = 48; flags1text = "[1] Spawn in all modes"; 2050 { title = "Duel Bomb"; + width = 24; + height = 48; + arrow = 1; flags8text = "[8] Flip strafe"; } @@ -5226,6 +5227,14 @@ thingtypes width = 45; height = 32; } + + 2057 + { + title = "Pogo Spring"; + sprite = "POGSA0"; + width = 48; + height = 32; + } } } diff --git a/src/info.c b/src/info.c index b05a20abc..7bdffe11d 100644 --- a/src/info.c +++ b/src/info.c @@ -8308,7 +8308,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_POGOSPRING - -1, // doomednum + 2057, // doomednum S_POGOSPRING1, // spawnstate 1000, // spawnhealth S_POGOSPRING2B, // seestate diff --git a/src/p_mobj.c b/src/p_mobj.c index 5b9ea4c75..6e699cbf5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11575,6 +11575,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) case MT_LANDMINE: case MT_HYUDORO_CENTER: case MT_DROPTARGET: + case MT_POGOSPRING: { // Duel objects. // Normally only spawn when placed by the map in Duels, @@ -12763,6 +12764,12 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean Obj_InitHyudoroCenter(mobj, NULL); break; } + case MT_POGOSPRING: + { + // Start as tumble version. + mobj->reactiontime++; + break; + } default: break; } From 4549ec5334b8bd7db8e22f91413704979c2914f7 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 28 Sep 2022 03:07:46 -0400 Subject: [PATCH 13/26] Fix duel bomb direction not working --- src/p_mobj.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6e699cbf5..c7dcac8ff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1703,7 +1703,13 @@ void P_XYMovement(mobj_t *mo) if (walltransferred == false) { - if (mo->flags & MF_SLIDEME) + if (mo->type == MT_DUELBOMB) + { + P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_BUMP); + Obj_DuelBombReverse(mo); + xmove = ymove = 0; + } + else if (mo->flags & MF_SLIDEME) { P_SlideMove(mo); if (P_MobjWasRemoved(mo)) @@ -1759,10 +1765,6 @@ void P_XYMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k44); // Bubble bounce break; - case MT_DUELBOMB: - Obj_DuelBombReverse(mo); - break; - default: break; } @@ -10329,9 +10331,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // Remove before release CONS_Alert(CONS_WARNING, "Boss waypoints are deprecated. Did you forget to remove the old checkpoints, too?\n"); break; - case MT_DUELBOMB: - Obj_DuelBombInit(mobj); - break; default: break; } @@ -12752,6 +12751,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean maptargets++; break; } + case MT_DUELBOMB: + { + // Duel Bomb needs init to match real map thing's angle + mobj->angle = FixedAngle(mthing->angle << FRACBITS); + Obj_DuelBombInit(mobj); + *doangle = false; + break; + } case MT_BANANA: { // Give Duel bananas a random angle From 2ba523e45cd347c0f0ca686601efd334fb3b914f Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Oct 2022 15:01:47 -0700 Subject: [PATCH 14/26] Remove unnecessary set old_angle after Hyudoro spawn --- src/objects/hyudoro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 9134a8c73..53b7ddc91 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -405,7 +405,7 @@ Obj_HyudoroDeploy (mobj_t *master) center->radius = hyu->radius; - hyu->angle = hyu->old_angle = master->angle; + hyu->angle = master->angle; P_SetTarget(&hyudoro_center(hyu), center); P_SetTarget(&hyudoro_center_master(center), master); From 8893666b536fc663b52c2f6f2ceae55924663d75 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Oct 2022 15:51:13 -0700 Subject: [PATCH 15/26] Refactor XD_GIVEITEM into CHEAT_GIVEITEM --- src/d_netcmd.c | 85 +++++++++++++++++++++++--------------------------- src/d_netcmd.h | 3 +- src/m_cheat.h | 1 + 3 files changed, 41 insertions(+), 48 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 435cc5b6f..218508473 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -83,7 +83,6 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum); static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum); static void Got_ModifyVotecmd(UINT8 **cp, INT32 playernum); static void Got_PickVotecmd(UINT8 **cp, INT32 playernum); -static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum); static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum); static void Got_Addfilecmd(UINT8 **cp, INT32 playernum); static void Got_Pause(UINT8 **cp, INT32 playernum); @@ -619,14 +618,13 @@ const char *netxcmdnames[MAXNETXCMD - 1] = "ACCEPTPARTYINVITE", // XD_ACCEPTPARTYINVITE "LEAVEPARTY", // XD_LEAVEPARTY "CANCELPARTYINVITE", // XD_CANCELPARTYINVITE - "GIVEITEM", // XD_GIVEITEM + "CHEAT", // XD_CHEAT "ADDBOT", // XD_ADDBOT "DISCORD", // XD_DISCORD "PLAYSOUND", // XD_PLAYSOUND "SCHEDULETASK", // XD_SCHEDULETASK "SCHEDULECLEAR", // XD_SCHEDULECLEAR "AUTOMATE", // XD_AUTOMATE - "CHEAT", // XD_CHEAT }; // ========================================================================= @@ -673,8 +671,6 @@ void D_RegisterServerCommands(void) RegisterNetXCmd(XD_MODIFYVOTE, Got_ModifyVotecmd); RegisterNetXCmd(XD_PICKVOTE, Got_PickVotecmd); - RegisterNetXCmd(XD_GIVEITEM, Got_GiveItemcmd); - RegisterNetXCmd(XD_SCHEDULETASK, Got_ScheduleTaskcmd); RegisterNetXCmd(XD_SCHEDULECLEAR, Got_ScheduleClearcmd); RegisterNetXCmd(XD_AUTOMATE, Got_Automatecmd); @@ -2068,6 +2064,11 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...) case CHEAT_DEVMODE: COPY(WRITEUINT32, UINT32); break; + + case CHEAT_GIVEITEM: + COPY(WRITESINT8, int); + COPY(WRITEUINT8, unsigned int); + break; } #undef COPY @@ -5388,41 +5389,6 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum) Y_SetupVoteFinish(pick, level); } -static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum) -{ - int item; - int amt; - - item = READSINT8 (*cp); - amt = READUINT8 (*cp); - - if ( - ( !CV_CheatsEnabled() ) || - ( item < KITEM_SAD || item >= NUMKARTITEMS ) - ) - { - CONS_Alert(CONS_WARNING, - M_GetText ("Illegal give item received from %s\n"), - player_names[playernum]); - if (server) - SendKick(playernum, KICK_MSG_CON_FAIL); - return; - } - - K_StripItems(&players[playernum]); - players[playernum].itemroulette = 0; - - players[playernum].itemtype = item; - players[playernum].itemamount = amt; - - CV_CheaterWarning( - playernum, - (amt != 1) // FIXME: we should have actual KITEM_ name array - ? va("kartgiveitem %s %d", cv_kartdebugitem.PossibleValue[item+1].strvalue, amt) - : va("kartgiveitem %s", cv_kartdebugitem.PossibleValue[item+1].strvalue) - ); -} - static void Got_ScheduleTaskcmd(UINT8 **cp, INT32 playernum) { char command[MAXTEXTCMD]; @@ -5682,6 +5648,35 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum) break; } + case CHEAT_GIVEITEM: { + SINT8 item = READSINT8(*cp); + UINT8 amt = READUINT8(*cp); + + item = max(item, KITEM_SAD); + item = min(item, NUMKARTITEMS - 1); + + K_StripItems(player); + + // Cancel roulette if rolling + player->itemroulette = 0; + + player->itemtype = item; + player->itemamount = amt; + + if (amt == 0) + { + CV_CheaterWarning(playernum, "delete my items"); + } + else + { + // FIXME: we should have actual KITEM_ name array + const char *itemname = cv_kartdebugitem.PossibleValue[1 + item].strvalue; + + CV_CheaterWarning(playernum, va("give item %s x%d", itemname, amt)); + } + break; + } + case NUMBER_OF_CHEATS: break; } @@ -5843,8 +5838,6 @@ static void Command_Archivetest_f(void) */ static void Command_KartGiveItem_f(void) { - char buf[2]; - int ac; const char *name; int item; @@ -5886,14 +5879,14 @@ static void Command_KartGiveItem_f(void) if (item < NUMKARTITEMS) { - buf[0] = item; + INT32 amt; if (ac > 2) - buf[1] = atoi(COM_Argv(2)); + amt = atoi(COM_Argv(2)); else - buf[1] = 1;/* default to one quantity */ + amt = 1;/* default to one quantity */ - SendNetXCmd(XD_GIVEITEM, buf, 2); + D_Cheat(consoleplayer, CHEAT_GIVEITEM, item, amt); } else { diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 2f2b2a25b..6b6795737 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -196,14 +196,13 @@ typedef enum XD_ACCEPTPARTYINVITE, // 29 XD_LEAVEPARTY, // 30 XD_CANCELPARTYINVITE, // 31 - XD_GIVEITEM, // 32 + XD_CHEAT, // 32 XD_ADDBOT, // 33 XD_DISCORD, // 34 XD_PLAYSOUND, // 35 XD_SCHEDULETASK, // 36 XD_SCHEDULECLEAR, // 37 XD_AUTOMATE, // 38 - XD_CHEAT, // 39 MAXNETXCMD } netxcmd_t; diff --git a/src/m_cheat.h b/src/m_cheat.h index b5e018afc..c84f3e8f2 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -30,6 +30,7 @@ typedef enum { CHEAT_HURT, CHEAT_RELATIVE_TELEPORT, CHEAT_DEVMODE, + CHEAT_GIVEITEM, NUMBER_OF_CHEATS } cheat_t; From 05ee87ba59440f312e6fe0ffbd173eeb23cc7db8 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Oct 2022 16:17:46 -0700 Subject: [PATCH 16/26] Rework and give item command - "kartgiveitem" renamed to just "item" - partial item name matches supported, e.g. type "item ring" - item 0/none to remove your item --- src/d_netcmd.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 218508473..5a20827dc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -731,7 +731,7 @@ void D_RegisterServerCommands(void) COM_AddCommand("downloads", Command_Downloads_f); - COM_AddCommand("kartgiveitem", Command_KartGiveItem_f); + COM_AddCommand("item", Command_KartGiveItem_f); COM_AddCommand("schedule_add", Command_Schedule_Add); COM_AddCommand("schedule_clear", Command_Schedule_Clear); @@ -5840,7 +5840,7 @@ static void Command_KartGiveItem_f(void) { int ac; const char *name; - int item; + INT32 item; const char * str; @@ -5852,7 +5852,7 @@ static void Command_KartGiveItem_f(void) if (ac < 2) { CONS_Printf( -"kartgiveitem [amount]: Give yourself an item\n" +"item [amount]: Give yourself an item\n" ); } else @@ -5867,12 +5867,19 @@ static void Command_KartGiveItem_f(void) } else { - for (i = 0; ( str = kartdebugitem_cons_t[i].strvalue ); ++i) + /* first check exact match */ + if (!CV_CompleteValue(&cv_kartdebugitem, &name, &item)) { - if (strcasecmp(name, str) == 0) + CONS_Printf("\x83" "Autocomplete:\n"); + + /* then do very loose partial matching */ + for (i = 0; ( str = kartdebugitem_cons_t[i].strvalue ); ++i) { - item = kartdebugitem_cons_t[i].value; - break; + if (strcasestr(str, name) != NULL) + { + CONS_Printf("\x83\t%s\n", str); + item = kartdebugitem_cons_t[i].value; + } } } } @@ -5884,7 +5891,7 @@ static void Command_KartGiveItem_f(void) if (ac > 2) amt = atoi(COM_Argv(2)); else - amt = 1;/* default to one quantity */ + amt = (item != KITEM_NONE);/* default to one quantity, or zero, if KITEM_NONE */ D_Cheat(consoleplayer, CHEAT_GIVEITEM, item, amt); } From 925adee72ffb8c0eb9818c3802a7433b3138846b Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 1 Oct 2022 16:37:59 -0700 Subject: [PATCH 17/26] Rename "item" command to "give" blame 05ee87ba5 --- src/d_netcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5a20827dc..1c3211860 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -731,7 +731,7 @@ void D_RegisterServerCommands(void) COM_AddCommand("downloads", Command_Downloads_f); - COM_AddCommand("item", Command_KartGiveItem_f); + COM_AddCommand("give", Command_KartGiveItem_f); COM_AddCommand("schedule_add", Command_Schedule_Add); COM_AddCommand("schedule_clear", Command_Schedule_Clear); @@ -5852,7 +5852,7 @@ static void Command_KartGiveItem_f(void) if (ac < 2) { CONS_Printf( -"item [amount]: Give yourself an item\n" +"give [amount]: Give yourself an item\n" ); } else From 4404d0c0980bc9002c108a9fbf774b50a798bff3 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 1 Oct 2022 22:23:52 -0400 Subject: [PATCH 18/26] Make hyu bob a static func --- src/objects/hyudoro.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 07147deca..21a5b8cc0 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -117,6 +117,16 @@ sine_bob sineofs + FINESINE(a >> ANGLETOFINESHIFT)); } +static void +bob_in_place +( mobj_t * hyu, + INT32 bob_speed) +{ + sine_bob(hyu, + (leveltime & (bob_speed - 1)) * + (ANGLE_MAX / bob_speed), -(3*FRACUNIT/4)); +} + static void project_hyudoro (mobj_t *hyu) { @@ -143,8 +153,6 @@ project_hyudoro (mobj_t *hyu) static void project_hyudoro_hover (mobj_t *hyu) { - const INT32 bob_speed = 64; - mobj_t *target = hyudoro_target(hyu); // Turns a bit toward its target @@ -170,9 +178,7 @@ project_hyudoro_hover (mobj_t *hyu) hyu->pitch = target->pitch; hyu->roll = target->roll; - sine_bob(hyu, - (leveltime & (bob_speed - 1)) * - (ANGLE_MAX / bob_speed), -(3*FRACUNIT/4)); + bob_in_place(hyu, 64); } static void @@ -242,7 +248,6 @@ do_confused (mobj_t *hyu) { // Hyudoro is confused. // Spin around, try to find a new target. - const INT32 bob_speed = 32; if (hyudoro_delivered(hyu)) { @@ -258,9 +263,7 @@ do_confused (mobj_t *hyu) hyu->angle += ANGLE_45; // Bob very fast - sine_bob(hyu, - (leveltime & (bob_speed - 1)) * - (ANGLE_MAX / bob_speed), -(3*FRACUNIT/4)); + bob_in_place(hyu, 32); hyu->sprzoff += hyu->height; } From bf6439731ccc41f4fc7b60e3afe75db63a0b7bc3 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 1 Oct 2022 22:28:33 -0400 Subject: [PATCH 19/26] Fix Duel Bomb tumble not scaling --- src/objects/duel-bomb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/objects/duel-bomb.c b/src/objects/duel-bomb.c index ace75f3b2..173efb933 100644 --- a/src/objects/duel-bomb.c +++ b/src/objects/duel-bomb.c @@ -77,18 +77,17 @@ void Obj_DuelBombTouch(mobj_t *bomb, mobj_t *toucher) boom->color = SKINCOLOR_KETCHUP; S_StartSound(boom, bomb->info->attacksound); - // Kill bomb - P_KillMobj(bomb, toucher, toucher, DMG_NORMAL); - if (player->invincibilitytimer > 0 || K_IsBigger(toucher, bomb) == true || player->flamedash > 0) { // Kill without damaging. + P_KillMobj(bomb, toucher, toucher, DMG_NORMAL); return; } P_DamageMobj(toucher, bomb, bomb, 1, DMG_TUMBLE); + P_KillMobj(bomb, toucher, toucher, DMG_NORMAL); } void Obj_DuelBombInit(mobj_t *bomb) From 7b7cbbbf26c39a68a551af7a852c2884bec25aaa Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 1 Oct 2022 22:58:58 -0400 Subject: [PATCH 20/26] Fix oddities with duel items not always spawning --- src/k_kart.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/k_kart.h | 3 +++ src/p_mobj.c | 28 ++++++++++++---------------- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 66432ad54..645aee529 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -49,10 +49,53 @@ // battlewanted is an array of the WANTED player nums, -1 for no player in that slot // mapreset is set when enough players fill an empty server +boolean K_IsDuelItem(mobjtype_t type) +{ + switch (type) + { + case MT_DUELBOMB: + case MT_BANANA: + case MT_EGGMANITEM: + case MT_SSMINE: + case MT_LANDMINE: + case MT_HYUDORO_CENTER: + case MT_DROPTARGET: + case MT_POGOSPRING: + return true; + + default: + return false; + } +} + +boolean K_DuelItemAlwaysSpawns(mapthing_t *mt) +{ + return (mt->options & MTF_EXTRA); +} + +static void K_SpawnDuelOnlyItems(void) +{ + mapthing_t *mt = NULL; + size_t i; + + mt = mapthings; + for (i = 0; i < nummapthings; i++, mt++) + { + mobjtype_t type = P_GetMobjtype(mt->type); + + if (K_IsDuelItem(type) == true + && K_DuelItemAlwaysSpawns(mt) == false) + { + P_SpawnMapThing(mt); + } + } +} + void K_TimerReset(void) { starttime = introtime = 3; numbulbs = 1; + inDuel = false; } void K_TimerInit(void) @@ -109,6 +152,12 @@ void K_TimerInit(void) // NOW you can try to spawn in the Battle capsules, if there's not enough players for a match K_BattleInit(); + + if (inDuel == true) + { + K_SpawnDuelOnlyItems(); + } + //CONS_Printf("numbulbs set to %d (%d players, %d spectators) on tic %d\n", numbulbs, numPlayers, numspec, leveltime); } diff --git a/src/k_kart.h b/src/k_kart.h index 7973a236c..a5d2b0185 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -38,6 +38,9 @@ angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t void K_RegisterKartStuff(void); +boolean K_IsDuelItem(mobjtype_t type); +boolean K_DuelItemAlwaysSpawns(mapthing_t *mt); + void K_TimerReset(void); void K_TimerInit(void); UINT32 K_GetPlayerDontDrawFlag(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index c3e8795b6..12a484218 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11755,30 +11755,26 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) return false; } break; - case MT_DUELBOMB: - case MT_BANANA: - case MT_EGGMANITEM: - case MT_SSMINE: - case MT_LANDMINE: - case MT_HYUDORO_CENTER: - case MT_DROPTARGET: - case MT_POGOSPRING: - { - // Duel objects. - // Normally only spawn when placed by the map in Duels, - // but can be forced to always spawn with the Extra flag. - if (inDuel == false && !(mthing->options & MTF_EXTRA)) - return false; - } - break; default: break; } + if (inDuel == false) + { + if (K_IsDuelItem(i) == true + && K_DuelItemAlwaysSpawns(mthing) == false) + { + // Only spawns in Duels. + return false; + } + } + // No bosses outside of a combat situation. // (just in case we want boss arenas to do double duty as battle maps) if (!bossinfo.boss && (mobjinfo[i].flags & MF_BOSS)) + { return false; + } if (metalrecording) // Metal Sonic can't use these things. { From 6a7c5050adb89ba1b998ca815b8b80c6b93b396d Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 1 Oct 2022 21:46:26 -0700 Subject: [PATCH 21/26] Restore SPB force-seek define as 'spbtest' cvar --- src/d_netcmd.c | 3 ++ src/d_netcmd.h | 2 +- src/k_kart.c | 1 + src/objects/spb.c | 116 ++++++++++++++++++++++++---------------------- 4 files changed, 65 insertions(+), 57 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 435cc5b6f..de352ee81 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -455,6 +455,9 @@ consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_C consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_CHEAT, CV_OnOff, NULL); consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_CHEAT, CV_OnOff, NULL); consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_CHEAT, CV_OnOff, NULL); +#ifdef DEVELOP + consvar_t cv_spbtest = CVAR_INIT ("spbtest", "Off", CV_CHEAT, CV_OnOff, NULL); +#endif static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 2f2b2a25b..eb1575b98 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -123,7 +123,7 @@ extern consvar_t cv_kartusepwrlv; extern consvar_t cv_votetime; extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop; -extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector; +extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector, cv_spbtest; extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict; extern consvar_t cv_itemfinder; diff --git a/src/k_kart.c b/src/k_kart.c index c7559d558..7aba7398c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -267,6 +267,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugnodes); CV_RegisterVar(&cv_kartdebugcolorize); CV_RegisterVar(&cv_kartdebugdirector); + CV_RegisterVar(&cv_spbtest); } //} diff --git a/src/objects/spb.c b/src/objects/spb.c index 0ea565e45..c38c6b9d1 100644 --- a/src/objects/spb.c +++ b/src/objects/spb.c @@ -24,8 +24,6 @@ #include "../k_waypoint.h" #include "../k_respawn.h" -// #define SPB_SEEKTEST - #define SPB_SLIPTIDEDELTA (ANG1 * 3) #define SPB_STEERDELTA (ANGLE_90 - ANG10) #define SPB_DEFAULTSPEED (FixedMul(mapobjectscale, K_GetKartSpeedFromStat(9) * 2)) @@ -107,8 +105,8 @@ static void SPBMantaRings(mobj_t *spb) Obj_MantaRingCreate( spb, spb_owner(spb), -#ifdef SPB_SEEKTEST - NULL +#ifdef DEVELOP + cv_spbtest.value ? NULL : spb_chase(spb) #else spb_chase(spb) #endif @@ -360,8 +358,11 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) spb->fuse = 2*TICRATE; } } -#ifndef SPB_SEEKTEST // Easy debug switch +#ifdef DEVELOP + else if (!cv_spbtest.value) +#else else +#endif { if (dist <= activeDist) { @@ -378,7 +379,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) return; } } -#endif if (SPBSeekSoundPlaying(spb) == false) { @@ -441,64 +441,68 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) if (pathfindsuccess == true) { -#ifdef SPB_SEEKTEST - if (pathtoplayer.numnodes > 1) - { - // Go to the next waypoint. - curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata; - } - else if (destWaypoint->numnextwaypoints > 0) - { - // Run ahead. - curWaypoint = destWaypoint->nextwaypoints[0]; +#ifdef DEVELOP + if (cv_spbtest.value) { + if (pathtoplayer.numnodes > 1) + { + // Go to the next waypoint. + curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata; + } + else if (destWaypoint->numnextwaypoints > 0) + { + // Run ahead. + curWaypoint = destWaypoint->nextwaypoints[0]; + } + else + { + // Sort of wait at the player's dest waypoint. + circling = true; + curWaypoint = destWaypoint; + } } else - { - // Sort of wait at the player's dest waypoint. - circling = true; - curWaypoint = destWaypoint; - } #else - path_t reversepath = {0}; - boolean reversesuccess = false; + { + path_t reversepath = {0}; + boolean reversesuccess = false; - huntbackwards = true; - reversesuccess = K_PathfindToWaypoint( - curWaypoint, destWaypoint, - &reversepath, - useshortcuts, huntbackwards - ); + huntbackwards = true; + reversesuccess = K_PathfindToWaypoint( + curWaypoint, destWaypoint, + &reversepath, + useshortcuts, huntbackwards + ); - if (reversesuccess == true - && reversepath.totaldist < pathtoplayer.totaldist) - { - // It's faster to go backwards than to chase forward. - // Keep curWaypoint the same, so the SPB waits around for them. - circling = true; - } - else if (pathtoplayer.numnodes > 1) - { - // Go to the next waypoint. - curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata; - } - else if (spb->fuse > 0 && destWaypoint->numnextwaypoints > 0) - { - // Run ahead. - curWaypoint = destWaypoint->nextwaypoints[0]; - } - else - { - // Sort of wait at the player's dest waypoint. - circling = true; - curWaypoint = destWaypoint; - } + if (reversesuccess == true + && reversepath.totaldist < pathtoplayer.totaldist) + { + // It's faster to go backwards than to chase forward. + // Keep curWaypoint the same, so the SPB waits around for them. + circling = true; + } + else if (pathtoplayer.numnodes > 1) + { + // Go to the next waypoint. + curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata; + } + else if (spb->fuse > 0 && destWaypoint->numnextwaypoints > 0) + { + // Run ahead. + curWaypoint = destWaypoint->nextwaypoints[0]; + } + else + { + // Sort of wait at the player's dest waypoint. + circling = true; + curWaypoint = destWaypoint; + } - if (reversesuccess == true) - { - Z_Free(reversepath.array); + if (reversesuccess == true) + { + Z_Free(reversepath.array); + } } #endif - Z_Free(pathtoplayer.array); } } From 47cdce239a0d2ede7729cfd22a63bfc0a7c1ce89 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 1 Oct 2022 22:26:17 -0700 Subject: [PATCH 22/26] Only register spbtest in DEVELOP --- src/k_kart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 7aba7398c..ee49a676c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -267,7 +267,10 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugnodes); CV_RegisterVar(&cv_kartdebugcolorize); CV_RegisterVar(&cv_kartdebugdirector); - CV_RegisterVar(&cv_spbtest); + + #ifdef DEVELOP + CV_RegisterVar(&cv_spbtest); + #endif } //} From 224bd9baf307829345f7bdf64bc3a1d6fbab5036 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sun, 2 Oct 2022 04:12:03 -0700 Subject: [PATCH 23/26] Don't DEVELOP guard spbtest --- src/d_netcmd.c | 4 +--- src/k_kart.c | 5 +---- src/objects/spb.c | 11 ----------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index de352ee81..ff5c9dd57 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -455,9 +455,7 @@ consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_C consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_CHEAT, CV_OnOff, NULL); consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_CHEAT, CV_OnOff, NULL); consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_CHEAT, CV_OnOff, NULL); -#ifdef DEVELOP - consvar_t cv_spbtest = CVAR_INIT ("spbtest", "Off", CV_CHEAT, CV_OnOff, NULL); -#endif +consvar_t cv_spbtest = CVAR_INIT ("spbtest", "Off", CV_CHEAT|CV_NETVAR, CV_OnOff, NULL); static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL); diff --git a/src/k_kart.c b/src/k_kart.c index ee49a676c..7aba7398c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -267,10 +267,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugnodes); CV_RegisterVar(&cv_kartdebugcolorize); CV_RegisterVar(&cv_kartdebugdirector); - - #ifdef DEVELOP - CV_RegisterVar(&cv_spbtest); - #endif + CV_RegisterVar(&cv_spbtest); } //} diff --git a/src/objects/spb.c b/src/objects/spb.c index c38c6b9d1..32cb0e12d 100644 --- a/src/objects/spb.c +++ b/src/objects/spb.c @@ -105,11 +105,7 @@ static void SPBMantaRings(mobj_t *spb) Obj_MantaRingCreate( spb, spb_owner(spb), -#ifdef DEVELOP cv_spbtest.value ? NULL : spb_chase(spb) -#else - spb_chase(spb) -#endif ); } } @@ -358,11 +354,7 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) spb->fuse = 2*TICRATE; } } -#ifdef DEVELOP else if (!cv_spbtest.value) -#else - else -#endif { if (dist <= activeDist) { @@ -441,7 +433,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) if (pathfindsuccess == true) { -#ifdef DEVELOP if (cv_spbtest.value) { if (pathtoplayer.numnodes > 1) { @@ -461,7 +452,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) } } else -#else { path_t reversepath = {0}; boolean reversesuccess = false; @@ -502,7 +492,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer) Z_Free(reversepath.array); } } -#endif Z_Free(pathtoplayer.array); } } From 4db2c48cc3195daed666b35393866a2a4c81a52b Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 8 Oct 2022 20:38:45 -0500 Subject: [PATCH 24/26] cmake: set executable name to ringracers --- src/sdl/CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 65550906e..60921b587 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -78,13 +78,7 @@ if(${SDL2_FOUND}) ) endif() - if(${CMAKE_SYSTEM} MATCHES Windows) - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2kart) - elseif(${CMAKE_SYSTEM} MATCHES Linux) - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME lsdlsrb2kart) - else() - set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME srb2kart) - endif() + set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ringracers) if(${CMAKE_SYSTEM} MATCHES Darwin) find_library(CORE_LIB CoreFoundation) From d80db6f51d99ac320cf8bdf4440339e899bc7024 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 8 Oct 2022 21:19:04 -0500 Subject: [PATCH 25/26] cmake: add COMPVERSION_UNCOMMITTED --- CMakeLists.txt | 11 ++++++----- cmake/Modules/GitUtilities.cmake | 16 ++++++++++++++++ src/comptime.c | 12 ++++++------ src/config.h.in | 6 ++++++ 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d37514f2..0771f712c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,20 +117,21 @@ set(SRB2_SDL2_EXE_NAME ringracers CACHE STRING "Executable binary output name") include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) -add_subdirectory(src) -if(NOT ${SRB2_CONFIG_DEV_BUILD}) - add_subdirectory(assets) -endif() - ## config.h generation set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary") include(GitUtilities) git_latest_commit(SRB2_COMP_COMMIT "${CMAKE_SOURCE_DIR}") git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}") +git_working_tree_dirty(SRB2_COMP_UNCOMMITTED "${CMAKE_SOURCE_DIR}") set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}") set(SRB2_COMP_REVISION "${SRB2_COMP_COMMIT}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h) +add_subdirectory(src) +if(NOT ${SRB2_CONFIG_DEV_BUILD}) + add_subdirectory(assets) +endif() + ##### PACKAGE CONFIGURATION ##### set(SRB2_CPACK_GENERATOR "" CACHE STRING "Generator to use for making a package. E.g., ZIP, TGZ, DragNDrop (OSX only). Leave blank for default generator.") diff --git a/cmake/Modules/GitUtilities.cmake b/cmake/Modules/GitUtilities.cmake index d29e6b509..4a94b5b5c 100644 --- a/cmake/Modules/GitUtilities.cmake +++ b/cmake/Modules/GitUtilities.cmake @@ -40,4 +40,20 @@ function(git_latest_commit variable path) ) set(${variable} "${output}" PARENT_SCOPE) +endfunction() + +function(git_working_tree_dirty variable path) + execute_process(COMMAND ${GIT_EXECUTABLE} "status" "--porcelain" "-uno" + WORKING_DIRECTORY "${path}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(output STREQUAL "") + set(${variable} FALSE PARENT_SCOPE) + else() + set(${variable} TRUE PARENT_SCOPE) + endif() endfunction() \ No newline at end of file diff --git a/src/comptime.c b/src/comptime.c index 81b5ec7d6..2baef79d6 100644 --- a/src/comptime.c +++ b/src/comptime.c @@ -15,6 +15,12 @@ const char *comprevision = SRB2_COMP_REVISION; #elif (defined(COMPVERSION)) #include "comptime.h" +#else +const char *compbranch = "Unknown"; +const char *comprevision = "illegal"; + +#endif + const int compuncommitted = #if (defined(COMPVERSION_UNCOMMITTED)) 1; @@ -22,11 +28,5 @@ const int compuncommitted = 0; #endif -#else -const char *compbranch = "Unknown"; -const char *comprevision = "illegal"; - -#endif - const char *compdate = __DATE__; const char *comptime = __TIME__; diff --git a/src/config.h.in b/src/config.h.in index 1636a6731..c27628ffd 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -22,6 +22,12 @@ #define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}" #define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}" +// This is done with configure_file instead of defines in order to avoid +// recompiling the whole target whenever the working directory state changes +#cmakedefine SRB2_COMP_UNCOMMITTED +#ifdef SRB2_COMP_UNCOMMITTED +#define COMPVERSION_UNCOMMITTED +#endif #define CMAKE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/assets" From 91c0d50c246973b13fa5300c4e7c2f0580c1a6f8 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sun, 9 Oct 2022 15:29:28 -0500 Subject: [PATCH 26/26] uncapped: Update closed captions only on new tics --- src/d_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 5d83c783b..f0f016ca7 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -875,7 +875,8 @@ void D_SRB2Loop(void) // consoleplayer -> displayplayers (hear sounds from viewpoint) S_UpdateSounds(); // move positional sounds - S_UpdateClosedCaptions(); + if (realtics > 0 || singletics) + S_UpdateClosedCaptions(); #ifdef HW3SOUND HW3S_EndFrameUpdate();