random cleanups

note: 2d camera didnt work anyways
This commit is contained in:
Alug committed 2025-05-18 16:44:09 +02:00
1 parent 38ce112e5c
commit 6b0e55d42f
12 files changed
+156 -484

No files matched your search

-71
View File
@@ -112,77 +112,6 @@ ticcmd_t *I_BaseTiccmd4(void);
*/
void I_Quit(void) FUNCNORETURN;
typedef enum
{
EvilForce = -1,
//Constant
ConstantForce = 0,
//Ramp
RampForce,
//Periodics
SquareForce,
SineForce,
TriangleForce,
SawtoothUpForce,
SawtoothDownForce,
//MAX
NumberofForces,
} FFType;
typedef struct JoyFF_s
{
INT32 ForceX; ///< The X of the Force's Vel
INT32 ForceY; ///< The Y of the Force's Vel
//All
UINT32 Duration; ///< The total duration of the effect, in microseconds
INT32 Gain; //< /The gain to be applied to the effect, in the range from 0 through 10,000.
//All, CONSTANTFORCE -10,000 to 10,000
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
//RAMPFORCE
INT32 Start; ///< Magnitude at the start of the effect, in the range from -10,000 through 10,000.
INT32 End; ///< Magnitude at the end of the effect, in the range from -10,000 through 10,000.
//PERIODIC
INT32 Offset; ///< Offset of the effect.
UINT32 Phase; ///< Position in the cycle of the periodic effect at which playback begins, in the range from 0 through 35,999
UINT32 Period; ///< Period of the effect, in microseconds.
} JoyFF_t;
/** \brief Forcefeedback for the first joystick
\param Type what kind of Effect
\param Effect Effect Info
\return void
*/
void I_Tactile(FFType Type, const JoyFF_t *Effect);
/** \brief Forcefeedback for the second joystick
\param Type what kind of Effect
\param Effect Effect Info
\return void
*/
void I_Tactile2(FFType Type, const JoyFF_t *Effect);
/** \brief Forcefeedback for the third joystick
\param Type what kind of Effect
\param Effect Effect Info
\return void
*/
void I_Tactile3(FFType Type, const JoyFF_t *Effect);
/** \brief Forcefeedback for the fourth joystick
\param Type what kind of Effect
\param Effect Effect Info
\return void
*/
void I_Tactile4(FFType Type, const JoyFF_t *Effect);
/** \brief to set up the first joystick scale
*/
-1
View File
@@ -291,7 +291,6 @@ boolean P_Move(mobj_t *actor, fixed_t speed)
*/
static boolean P_TryWalk(mobj_t *actor)
{
if (!P_Move(actor, actor->info->speed))
return false;
+20 -53
View File
@@ -452,25 +452,16 @@ void T_MoveElevator(elevator_t *elevator)
const fixed_t dh = abs(elevator->sector->floorheight - elevator->floordestheight);
// Slow down when reaching destination Tails 12-06-2000
if (wh < dh)
elevator->speed = FixedDiv(wh,25*FRACUNIT) + FRACUNIT/4;
else
elevator->speed = FixedDiv(dh,25*FRACUNIT) + FRACUNIT/4;
elevator->speed = FixedDiv(((wh < dh) ? wh : dh), 25*FRACUNIT) + FRACUNIT/4;
if (elevator->origspeed)
{
elevator->speed = FixedMul(elevator->speed,origspeed);
if (elevator->speed > elevator->origspeed)
elevator->speed = (elevator->origspeed);
if (elevator->speed < 1)
elevator->speed = 1;
elevator->speed = FixedMul(elevator->speed, origspeed);
elevator->speed = CLAMP(elevator->speed, 1, elevator->origspeed);
}
else
{
if (elevator->speed > 3*FRACUNIT)
elevator->speed = 3*FRACUNIT;
if (elevator->speed < 1)
elevator->speed = 1;
elevator->speed = CLAMP(elevator->speed, 1, 3*FRACUNIT);
}
}
@@ -513,26 +504,18 @@ void T_MoveElevator(elevator_t *elevator)
const fixed_t origspeed = FixedDiv(elevator->origspeed,(ELEVATORSPEED/2));
const fixed_t wc = abs(elevator->sector->ceilingheight - elevator->ceilingwasheight);
const fixed_t dc = abs(elevator->sector->ceilingheight - elevator->ceilingdestheight);
// Slow down when reaching destination Tails 12-06-2000
if (wc < dc)
elevator->speed = FixedDiv(wc,25*FRACUNIT) + FRACUNIT/4;
else
elevator->speed = FixedDiv(dc,25*FRACUNIT) + FRACUNIT/4;
elevator->speed = FixedDiv(((wc < dc) ? wc : dc), 25*FRACUNIT) + FRACUNIT/4;
if (elevator->origspeed)
{
elevator->speed = FixedMul(elevator->speed,origspeed);
if (elevator->speed > elevator->origspeed)
elevator->speed = (elevator->origspeed);
if (elevator->speed < 1)
elevator->speed = 1;
elevator->speed = FixedMul(elevator->speed, origspeed);
elevator->speed = CLAMP(elevator->speed, 1, elevator->origspeed);
}
else
{
if (elevator->speed > 3*FRACUNIT)
elevator->speed = 3*FRACUNIT;
if (elevator->speed < 1)
elevator->speed = 1;
elevator->speed = CLAMP(elevator->speed, 1, 3*FRACUNIT);
}
}
@@ -571,11 +554,7 @@ void T_MoveElevator(elevator_t *elevator)
else
res = res1;
}
/*
// make floor move sound
if (!(leveltime&7))
S_StartSound(&elevator->sector->soundorg, sfx_stnmov);
*/
if (res == pastdest || res == crushed) // if destination height acheived
{
if (elevator->type == elevateContinuous)
@@ -608,7 +587,6 @@ void T_MoveElevator(elevator_t *elevator)
elevator->ceilingdestheight =
elevator->floordestheight + elevator->sector->ceilingheight - elevator->sector->floorheight;
}
// T_MoveElevator(elevator);
}
else
{
@@ -638,7 +616,6 @@ void T_MoveElevator(elevator_t *elevator)
elevator->ceilingdestheight =
elevator->floordestheight + elevator->sector->ceilingheight - elevator->sector->floorheight;
}
// T_MoveElevator(elevator);
}
elevator->delaytimer = elevator->delay;
}
@@ -651,9 +628,8 @@ void T_MoveElevator(elevator_t *elevator)
P_RemoveThinker(&elevator->thinker); // remove elevator from actives
dontupdate = true;
}
// make floor stop sound
// S_StartSound(&elevator->sector->soundorg, sfx_pstop);
}
if (!dontupdate)
{
elevator->sector->floorspeed = elevator->speed*elevator->direction;
@@ -2154,10 +2130,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
if (!players[j].ingame)
continue;
if (!players[j].mo)
continue;
if (players[j].mo->health <= 0)
if (!players[j].mo || (players[j].mo->health <= 0))
continue;
if ((netgame || multiplayer) && players[j].spectator)
@@ -2168,6 +2141,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH)
{
boolean insector = false;
for (node = players[j].mo->touching_sectorlist; node; node = node->m_sectorlist_next)
{
if (node->m_sector == targetsec)
@@ -2176,6 +2150,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
break;
}
}
if (!insector)
continue;
}
@@ -2220,10 +2195,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
if (!players[i].ingame)
continue;
if (!players[i].mo)
continue;
if (players[i].mo->health <= 0)
if (!players[i].mo || (players[i].mo->health <= 0))
continue;
if ((netgame || multiplayer) && players[i].spectator)
@@ -2234,6 +2206,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
else if (sec->flags & SF_TRIGGERSPECIAL_TOUCH)
{
boolean insector = false;
for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next)
{
if (node->m_sector == sec)
@@ -2242,6 +2215,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
break;
}
}
if (!insector)
continue;
}
@@ -2302,10 +2276,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
if (!players[i].ingame)
continue;
if (!players[i].mo)
continue;
if (players[i].mo->health <= 0)
if (!players[i].mo || (players[i].mo->health <= 0))
continue;
if ((netgame || multiplayer) && players[i].spectator)
@@ -2359,11 +2330,7 @@ void T_RaiseSector(levelspecthink_t *raise)
{
thing = node->m_thing;
if (!thing->player)
continue;
// Ignore spectators.
if (thing->player && thing->player->spectator)
if (!thing->player || thing->player->spectator) // Ignore spectators.
continue;
// Option to require spindashing.
@@ -2956,6 +2923,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
if (R_PointInSubsector(a, b)->sector == sec)
{
mobj_t *spawned = NULL;
for (c = topz; c > *rover->bottomheight; c -= spacing)
{
spawned = P_SpawnMobj(a, b, c, type);
@@ -3120,7 +3088,6 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
for (i = -1; (i = P_FindSectorFromTag(elevator->sourceline->tag, i)) >= 0 ;)
{
foundsec = &sectors[i];
P_SpawnMobj(foundsec->soundorg.x, foundsec->soundorg.y, elevator->direction == 1 ? elevator->sector->floorheight : elevator->sector->ceilingheight, MT_CRUMBLEOBJ);
}
+14 -88
View File
@@ -37,62 +37,6 @@
#define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : ""
#define CTFTEAMENDCODE(pl) pl->ctfteam ? "\x80" : ""
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period)
{
BasicFF_t Basicfeed;
if (!player)
return;
Basicfeed.Duration = (UINT32)(duration * (100L/TICRATE));
Basicfeed.ForceX = Basicfeed.ForceY = 1;
Basicfeed.Gain = 25000;
Basicfeed.Magnitude = period*10;
Basicfeed.player = player;
/// \todo test FFB
P_RampConstant(&Basicfeed, attack, fade);
}
void P_ForceConstant(const BasicFF_t *FFInfo)
{
JoyFF_t ConstantQuake;
if (!FFInfo || !FFInfo->player)
return;
ConstantQuake.ForceX = FFInfo->ForceX;
ConstantQuake.ForceY = FFInfo->ForceY;
ConstantQuake.Duration = FFInfo->Duration;
ConstantQuake.Gain = FFInfo->Gain;
ConstantQuake.Magnitude = FFInfo->Magnitude;
if (FFInfo->player == &players[consoleplayer])
I_Tactile(ConstantForce, &ConstantQuake);
else if (splitscreen && FFInfo->player == &players[displayplayers[1]])
I_Tactile2(ConstantForce, &ConstantQuake);
else if (splitscreen > 1 && FFInfo->player == &players[displayplayers[2]])
I_Tactile3(ConstantForce, &ConstantQuake);
else if (splitscreen > 2 && FFInfo->player == &players[displayplayers[3]])
I_Tactile4(ConstantForce, &ConstantQuake);
}
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
{
JoyFF_t RampQuake;
if (!FFInfo || !FFInfo->player)
return;
RampQuake.ForceX = FFInfo->ForceX;
RampQuake.ForceY = FFInfo->ForceY;
RampQuake.Duration = FFInfo->Duration;
RampQuake.Gain = FFInfo->Gain;
RampQuake.Magnitude = FFInfo->Magnitude;
RampQuake.Start = Start;
RampQuake.End = End;
if (FFInfo->player == &players[consoleplayer])
I_Tactile(ConstantForce, &RampQuake);
else if (splitscreen && FFInfo->player == &players[displayplayers[1]])
I_Tactile2(ConstantForce, &RampQuake);
else if (splitscreen > 1 && FFInfo->player == &players[displayplayers[2]])
I_Tactile3(ConstantForce, &RampQuake);
else if (splitscreen > 2 && FFInfo->player == &players[displayplayers[3]])
I_Tactile4(ConstantForce, &RampQuake);
}
//
// GET STUFF
//
@@ -107,9 +51,6 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
if (player->exiting || mapreset)
return false;
/*if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) // No bumpers in Match
return false;*/
if (weapon)
{
// Item slot already taken up
@@ -374,7 +315,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else
{
K_DropItems(player); //K_StripItems(player);
//K_StripOther(player);
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 2;
}
@@ -842,8 +782,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return;
if (special->fuse == 1)
return;
// if (special->momz > 0)
// return;
{
UINT8 flagteam = (special->type == MT_REDFLAG) ? 1 : 2;
const char *flagtext;
@@ -2291,7 +2229,7 @@ static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj
return true;
}
static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
static void P_KillPlayer(player_t *player, mobj_t *source)
{
player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE);
@@ -2310,8 +2248,6 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
// Get rid of emeralds
player->powers[pw_emeralds] = 0;
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
P_ResetPlayer(player);
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
@@ -2376,14 +2312,12 @@ void P_RemoveShield(player_t *player)
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
}
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source)
{
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
{
P_DoPlayerPain(player, source, inflictor);
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
S_StartSound(player->mo, sfx_spkdth);
}
@@ -2417,10 +2351,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
return false;
// well no clue but this may happen ig
if (!target)
return false;
if (target->health <= 0)
if (!target || (target->health <= 0))
return false;
// Spectator handling
@@ -2442,6 +2373,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (P_MobjWasRemoved(target))
return (shouldForce == 1); // mobj was removed
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
@@ -2582,7 +2514,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Instant-Death
if (damage == DMG_INSTAKILL)
P_KillPlayer(player, source, damage);
P_KillPlayer(player, source);
else if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->powers[pw_flashing])
{
if (!force) // shoulddamage bypasses all of that.
@@ -2600,8 +2533,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
player->kartstuff[k_sneakertimer] = 0;
K_SpinPlayer(player, source, 1, inflictor, false);
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
P_RingDamage(player, inflictor, source);
P_PlayerRingBurst(player, 5);
if (P_IsLocalPlayer(player))
{
P_StartQuake(5, 32<<FRACBITS, 0);
@@ -2611,6 +2545,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
{
K_SpinPlayer(player, source, 0, inflictor, false);
}
return true;
}
@@ -2644,8 +2579,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (player->health < 0)
player->health = 0;
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
}
// Killing dead. Just for kicks.
@@ -2679,19 +2612,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
}
else
{
switch (target->type)
{
case MT_EGGMOBILE2: // egg slimer
if (target->health < target->info->damage) // in pinch phase
{
P_SetMobjState(target, target->info->meleestate); // go to pinch pain state
break;
}
/* FALLTHRU */
default:
// egg slimer
if (target->type == MT_EGGMOBILE2 && (target->health < target->info->damage)) // in pinch phase
P_SetMobjState(target, target->info->meleestate); // go to pinch pain state
else
P_SetMobjState(target, target->info->painstate);
break;
}
}
if (!P_MobjWasRemoved(target))
@@ -2703,6 +2628,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// if not intent on another player,
// chase after this one
P_SetTarget(&target->target, source);
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
{
if (player)
-14
View File
@@ -435,25 +435,11 @@ extern struct minimapinfo
//
// P_INTER
//
typedef struct BasicFF_s
{
INT32 ForceX; ///< The X of the Force's Vel
INT32 ForceY; ///< The Y of the Force's Vel
const player_t *player; ///< Player of Rumble
//All
UINT32 Duration; ///< The total duration of the effect, in microseconds
INT32 Gain; ///< /The gain to be applied to the effect, in the range from 0 through 10,000.
//All, CONSTANTFORCE �10,000 to 10,000
INT32 Magnitude; ///< Magnitude of the effect, in the range from 0 through 10,000.
} BasicFF_t;
// replace damage magic numbers with smth readable
#define DMG_INSTAKILL 10000
#define DMG_SPECTATOR 42000
void P_ForceFeed(const player_t *player, INT32 attack, INT32 fade, tic_t duration, INT32 period);
void P_ForceConstant(const BasicFF_t *FFInfo);
void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End);
void P_RemoveShield(player_t *player);
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage);
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source);
+22 -40
View File
@@ -333,11 +333,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
#ifdef SEENAMES
// Do name checks all the way up here
// So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
// Do name checks all the way up here
// So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
if (tmthing->type == MT_NAMECHECK)
{
// Ignore things that aren't players, ignore spectators, ignore yourself.
// Ignore things that aren't players, ignore spectators, ignore yourself.
// (also don't bother to check that tmthing->target->player is non-NULL because we're not actually using it here.)
if (!thing->player || thing->player->spectator || (tmthing->target && thing->player == tmthing->target->player))
return true;
@@ -505,17 +505,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
// check for skulls slamming into things
if (tmthing->flags2 & MF2_SKULLFLY)
{
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
tmthing->flags2 &= ~MF2_SKULLFLY;
tmthing->momx = tmthing->momy = tmthing->momz = 0;
return false; // stop moving
}
tmthing->flags2 &= ~MF2_SKULLFLY;
tmthing->momx = tmthing->momy = tmthing->momz = 0;
return false; // stop moving
}
// SRB2kart 011617 - Colission[sic] code for kart items //{
@@ -543,10 +541,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->health)
P_KillMobj(thing, tmthing, tmthing);
/*if (tmthing->player && (tmthing->player->kartstuff[k_invincibilitytimer] > 0
|| tmthing->player->kartstuff[k_growshrinktimer] > 0))
return true;*/
K_KartBouncing(tmthing, thing, false, true);
return false;
}
@@ -729,7 +723,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (!(thing->type == MT_PLAYER))
if (thing->type != MT_PLAYER)
return true;
if (thing->player && thing->player->powers[pw_flashing])
@@ -1749,7 +1743,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
if (!(rover->flags & FF_EXISTS))
continue;
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
@@ -1771,14 +1765,16 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
// Land on the top or the bottom, depending on gravity flip.
if (!(thing->eflags & MFE_VERTICALFLIP) && thing->z >= topheight - sinklevel && thing->momz <= 0)
{
if (tmfloorz < topheight - sinklevel) {
if (tmfloorz < topheight - sinklevel)
{
tmfloorz = topheight - sinklevel;
tmfloorslope = *rover->t_slope;
}
}
else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0)
{
if (tmceilingz > bottomheight + sinklevel) {
if (tmceilingz > bottomheight + sinklevel)
{
tmceilingz = bottomheight + sinklevel;
tmceilingslope = *rover->b_slope;
}
@@ -1800,7 +1796,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
{
if (thing->z < topheight && bottomheight < thingtop)
{
if (tmfloorz < thing->z) {
if (tmfloorz < thing->z)
{
tmfloorz = thing->z;
tmfloorslope = NULL;
}
@@ -1820,6 +1817,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
tmfloorz = tmdropoffz = topheight;
tmfloorslope = *rover->t_slope;
}
if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
&& !(rover->flags & FF_PLATFORM)
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
@@ -2175,7 +2173,6 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
subsector_t *s;
boolean retval = true;
boolean itsatwodlevel = false;
UINT8 i;
floatok = false;
@@ -2188,22 +2185,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
else
s = thiscam->subsector;
if (twodlevel)
itsatwodlevel = true;
else
{
for (i = 0; i <= splitscreen; i++)
{
if (thiscam == &camera[i] && players[displayplayers[i]].mo
&& (players[displayplayers[i]].mo->flags2 & MF2_TWOD))
{
itsatwodlevel = true;
break;
}
}
}
if (!itsatwodlevel && players[displayplayers[0]].mo)
if (players[displayplayers[0]].mo)
{
fixed_t tryx = thiscam->x;
fixed_t tryy = thiscam->y;
@@ -2270,7 +2252,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
}
else
{
tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
tmfloorz = P_CameraGetFloorZ(thiscam, thiscam->subsector->sector, x, y, NULL);
tmceilingz = P_CameraGetCeilingZ(thiscam, thiscam->subsector->sector, x, y, NULL);
}
+6 -29
View File
@@ -1104,7 +1104,6 @@ void P_CheckGravity(mobj_t *mo, boolean affect)
}
}
//
// P_SceneryXYFriction
//
@@ -1123,13 +1122,13 @@ static void P_SceneryXYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
{
if ((oldx == mo->x) && (oldy == mo->y)) // didn't go anywhere
{
mo->momx = FixedMul(mo->momx,ORIG_FRICTION);
mo->momy = FixedMul(mo->momy,ORIG_FRICTION);
mo->momx = FixedMul(mo->momx, ORIG_FRICTION);
mo->momy = FixedMul(mo->momy, ORIG_FRICTION);
}
else
{
mo->momx = FixedMul(mo->momx,mo->friction);
mo->momy = FixedMul(mo->momy,mo->friction);
mo->momx = FixedMul(mo->momx, mo->friction);
mo->momy = FixedMul(mo->momy, mo->friction);
}
if (mo->type == MT_CANNONBALLDECOR)
@@ -3299,30 +3298,12 @@ void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
// Process the mobj-ish required functions of the camera
boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled)
{
boolean itsatwodlevel = false;
UINT8 i;
// This can happen when joining
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
return true;
P_CalcChasePostImg(player, thiscam);
if (twodlevel)
itsatwodlevel = true;
else
{
for (i = 0; i <= splitscreen; i++)
{
if (thiscam == &camera[i] && players[displayplayers[i]].mo
&& (players[displayplayers[i]].mo->flags2 & MF2_TWOD))
{
itsatwodlevel = true;
break;
}
}
}
if (thiscam->momx || thiscam->momy)
{
if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) // Never fails for 2D mode.
@@ -3349,9 +3330,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
}
}
if (!itsatwodlevel)
P_CheckCameraPosition(thiscam->x, thiscam->y, thiscam);
thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y);
thiscam->floorz = tmfloorz;
thiscam->ceilingz = tmceilingz;
@@ -3405,9 +3383,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
#endif
}
if (itsatwodlevel
|| (thiscam->ceilingz - thiscam->z < thiscam->height
&& thiscam->ceilingz >= thiscam->z))
if (thiscam->ceilingz - thiscam->z < thiscam->height
&& thiscam->ceilingz >= thiscam->z)
{
thiscam->ceilingz = thiscam->z + thiscam->height;
thiscam->floorz = thiscam->z;
+36 -35
View File
@@ -72,8 +72,8 @@ static void P_UpdateSlopeLightOffset(pslope_t *slope)
* // We reverse it in R_FindPlane now.
* nX = -nX;
* nY = -nY;
}
*/
* }
*/
light = FixedMul(nX, FINECOSINE(maplighting.angle >> ANGLETOFINESHIFT))
+ FixedMul(nY, FINESINE(maplighting.angle >> ANGLETOFINESHIFT));
@@ -233,9 +233,11 @@ void P_RunDynamicSlopes(void)
I_Error("P_RunDynamicSlopes: slope has invalid type!");
}
if (slope->zdelta != FixedDiv(zdelta, slope->extent))
const fixed_t zeedelta = FixedDiv(zdelta, slope->extent);
if (slope->zdelta != zeedelta)
{
slope->zdelta = FixedDiv(zdelta, slope->extent);
slope->zdelta = zeedelta;
slope->zangle = R_PointToAngle2(0, 0, slope->extent, -zdelta);
slope->real_zangle = slope->zangle;
P_CalculateSlopeNormal(slope);
@@ -295,18 +297,18 @@ static fixed_t P_GetExtent(sector_t *sector, line_t *line)
fixed_t dist;
// Don't compare to the slope line.
if(li == line)
if (li == line)
continue;
P_ClosestPointOnLine(li->v1->x, li->v1->y, line, &tempv);
dist = R_PointToDist2(tempv.x, tempv.y, li->v1->x, li->v1->y);
if(dist > fardist)
if (dist > fardist)
fardist = dist;
// Okay, maybe do it for v2 as well?
P_ClosestPointOnLine(li->v2->x, li->v2->y, line, &tempv);
dist = R_PointToDist2(tempv.x, tempv.y, li->v2->x, li->v2->y);
if(dist > fardist)
if (dist > fardist)
fardist = dist;
}
@@ -357,11 +359,9 @@ void P_SpawnSlope_Line(int linenum)
return;
}
{
fixed_t len = R_PointToDist2(0, 0, line->dx, line->dy);
nx = FixedDiv(line->dy, len);
ny = -FixedDiv(line->dx, len);
}
fixed_t len = R_PointToDist2(0, 0, line->dx, line->dy);
nx = FixedDiv(line->dy, len);
ny = -FixedDiv(line->dx, len);
origin.x = line->v1->x + (line->v2->x - line->v1->x)/2;
origin.y = line->v1->y + (line->v2->y - line->v1->y)/2;
@@ -377,7 +377,7 @@ void P_SpawnSlope_Line(int linenum)
extent = P_GetExtent(line->frontsector, line);
if(extent < 0)
if (extent < 0)
{
CONS_Printf("P_SpawnSlope_Line failed to get frontsector extent on line number %i\n", linenum);
return;
@@ -694,9 +694,9 @@ void P_CopySectorSlope(line_t *line)
{
sector_t *srcsec = sectors + i;
if((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
if ((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
fsec->f_slope = srcsec->f_slope; //P_CopySlope(srcsec->f_slope);
if((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
if ((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope);
}
@@ -782,25 +782,24 @@ void P_ResetDynamicSlopes(void)
if (!(lines[i].flags & ML_NOTAILS))
flags |= SL_NODYNAMIC;
if (which == 704)
switch (which)
{
slopetoset = &lines[i].frontsector->f_slope;
which = 0;
}
else if (which == 705)
{
slopetoset = &lines[i].frontsector->c_slope;
which = 0;
}
else if (which == 714)
{
slopetoset = &lines[i].backsector->f_slope;
which = 1;
}
else // 715
{
slopetoset = &lines[i].backsector->c_slope;
which = 1;
case 704:
slopetoset = &lines[i].frontsector->f_slope;
which = 0;
break;
case 705:
slopetoset = &lines[i].frontsector->c_slope;
which = 0;
break;
case 714:
slopetoset = &lines[i].backsector->f_slope;
which = 1;
break;
default: // 715
slopetoset = &lines[i].backsector->c_slope;
which = 1;
break;
}
if (lines[i].flags & ML_NOKNUX)
@@ -944,10 +943,12 @@ void P_ButteredSlope(mobj_t *mo)
if (mo->player)
{
if (abs(mo->standingslope->zdelta) < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING))
const int zeedelta = abs(mo->standingslope->zdelta);
if (zeedelta < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING))
return; // Don't slide on non-steep slopes unless spinning
if (abs(mo->standingslope->zdelta) < FRACUNIT/2 && !(mo->player->rmomx || mo->player->rmomy))
if (zeedelta < FRACUNIT/2 && !(mo->player->rmomx || mo->player->rmomy))
return; // Allow the player to stand still on slopes below a certain steepness
}
+25 -42
View File
@@ -3538,6 +3538,7 @@ DoneSection2:
for (UINT8 j = 0; j <= splitscreen; ++j)
{
INT32 id = (j == 0 ? consoleplayer : displayplayers[j]);
if (player == &players[id])
{
localangle[j] = player->mo->angle;
@@ -3574,7 +3575,6 @@ DoneSection2:
sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons
if (cv_kartvoices.value)
S_StartSound(player->mo, sfx_kbost1+pick);
//K_TauntVoiceTimers(player);
}
}
break;
@@ -3802,12 +3802,6 @@ DoneSection2:
if (!(player->mo->state >= &states[S_KART_RUN1] && player->mo->state <= &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
//if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4])) // SRB2kart
//{
// P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
// S_StartSound(player->mo, sfx_spin);
//}
}
break;
@@ -3963,12 +3957,6 @@ DoneSection2:
S_StartSound(NULL, sfx_s221);
}
//player->starpostangle = player->starposttime = player->starpostnum = 0;
//player->starpostx = player->starposty = player->starpostz = 0;
// Play the starpost sound for 'consistency'
// S_StartSound(player->mo, sfx_strpst);
thwompsactive = true; // Lap 2 effects
player->grieftime = 0;
}
@@ -4809,11 +4797,11 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
i = 0;
th = thinkercap.next;
for(;;)
for (;;)
{
if(secthinkers)
if (secthinkers)
{
if(i < secthinkers[sec2num].count)
if (i < secthinkers[sec2num].count)
th = secthinkers[sec2num].thinkers[i];
else break;
}
@@ -4845,8 +4833,10 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
Add_Pusher(p->type, p->x_mag<<FRACBITS, p->y_mag<<FRACBITS, p->source, (INT32)(sec-sectors), p->affectee, p->exclusive, p->slider);
}
if(secthinkers) i++;
else th = th->next;
if (secthinkers)
i++;
else
th = th->next;
}
if (flags & FF_TRANSLUCENT)
@@ -6371,6 +6361,7 @@ static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinker
static void P_DoScrollMove(mobj_t *thing, fixed_t dx, fixed_t dy, INT32 exclusive)
{
fixed_t fuckaj = 0; // Nov 05 14:12:08 <+MonsterIestyn> I've heard of explicitly defined variables but this is ridiculous
if (thing->player)
{
if (!(dx | dy))
@@ -6392,7 +6383,8 @@ static void P_DoScrollMove(mobj_t *thing, fixed_t dx, fixed_t dy, INT32 exclusiv
else if (thing->friction != ORIG_FRICTION)
fuckaj = thing->friction;
if (fuckaj) {
if (fuckaj)
{
// refactor thrust for new friction
dx = FixedDiv(dx, CARRYFACTOR);
dy = FixedDiv(dy, CARRYFACTOR);
@@ -6451,9 +6443,6 @@ void T_Scroll(scroll_t *s)
s->vdy = dy += s->vdy;
}
// if (!(dx | dy)) // no-op if both (x,y) offsets 0
// return;
switch (s->type)
{
side_t *side;
@@ -6729,27 +6718,21 @@ static void P_SpawnScrollers(void)
// this linedef controls the direction and speed of the scrolling. The
// most complicated linedef since donuts, but powerful :)
if (special == 515 || special == 512 || special == 522 || special == 532 || special == 504) // displacement scrollers
switch (special)
{
special -= 2;
control = (INT32)(sides[*l->sidenum].sector - sectors);
}
else if (special == 514 || special == 511 || special == 521 || special == 531 || special == 503) // accelerative scrollers
{
special--;
accel = 1;
control = (INT32)(sides[*l->sidenum].sector - sectors);
}
else if (special == 535 || special == 525) // displacement scrollers
{
special -= 2;
control = (INT32)(sides[*l->sidenum].sector - sectors);
}
else if (special == 534 || special == 524) // accelerative scrollers
{
accel = 1;
special--;
control = (INT32)(sides[*l->sidenum].sector - sectors);
case 515: case 512: case 522: case 532: case 504:
case 535: case 525: // displacement scrollers
special -= 2;
control = (INT32)(sides[*l->sidenum].sector - sectors);
break;
case 514: case 511: case 521: case 531: case 503:
case 534: case 524: // accelerative scrollers
special--;
accel = 1;
control = (INT32)(sides[*l->sidenum].sector - sectors);
break;
}
switch (special)
+32 -76
View File
@@ -135,9 +135,6 @@ boolean P_AutoPause(void)
//
void P_CalcHeight(player_t *player)
{
//INT32 angle;
//fixed_t bob;
//fixed_t pviewheight;
mobj_t *mo = player->mo;
// Regular movement bobbing.
@@ -256,7 +253,6 @@ void P_GiveEmerald(boolean spawnObj)
void P_ResetScore(player_t *player)
{
// Formally a host for Chaos mode behavior
player->scoreadd = 0;
}
@@ -606,15 +602,22 @@ static boolean isPlayerLosing(player_t *player)
UINT8 pos = 1;
UINT8 maxpos = 1;
for (int i = 0; i < MAXPLAYERS; ++i) {
if (!players[i].ingame || players[i].spectator) continue;
if (players[i].marescore > player->marescore) ++pos;
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (!players[i].ingame || players[i].spectator)
continue;
if (players[i].marescore > player->marescore)
++pos;
maxpos = max(getPlayerPos(&players[i]), maxpos);
}
if (maxpos == 1) return false;
if (maxpos == 1)
return false;
if (maxpos % 2) ++maxpos;
if (maxpos % 2)
++maxpos;
return pos > (maxpos / 2);
}
@@ -1182,26 +1185,28 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
else
ghost->angle = mobj->angle;
ghost->pitch = mobj->pitch;
ghost->roll = mobj->roll;
ghost->sprite = mobj->sprite;
ghost->frame = mobj->frame;
ghost->tics = -1;
ghost->frame &= ~FF_TRANSMASK;
ghost->frame |= tr_trans50<<FF_TRANSSHIFT;
ghost->slopepitch = mobj->slopepitch;
ghost->sloperoll = mobj->sloperoll;
ghost->fuse = ghost->info->damage;
ghost->skin = mobj->skin;
ghost->localskin = mobj->localskin;
ghost->skinlocal = mobj->skinlocal;
ghost->spritexscale = mobj->spritexscale;
ghost->spriteyscale = mobj->spriteyscale;
ghost->spritexoffset = mobj->spritexoffset;
ghost->spriteyoffset = mobj->spriteyoffset;
ghost->pitch = mobj->pitch;
ghost->roll = mobj->roll;
ghost->sloperoll = mobj->sloperoll;
ghost->rollangle = mobj->rollangle;
ghost->sloperoll = mobj->sloperoll;
ghost->slopepitch = mobj->slopepitch;
if (mobj->flags2 & MF2_OBJECTFLIP)
ghost->flags |= MF2_OBJECTFLIP;
@@ -1698,7 +1703,6 @@ static void P_CheckInvincibilityTimer(player_t *player)
}
}
//
// P_DoBubbleBreath
//
@@ -1868,11 +1872,8 @@ static void P_3dMovement(player_t *player)
{
ticcmd_t *cmd;
angle_t movepushangle, movepushsideangle; // Analog
//INT32 topspeed, acceleration, thrustfactor;
fixed_t movepushforward = 0, movepushside = 0;
angle_t dangle; // replaces old quadrants bits
//boolean dangleflip = false; // SRB2kart - toaster
//fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
boolean analogmove = false;
fixed_t oldMagnitude, newMagnitude;
vector3_t totalthrust;
@@ -1910,20 +1911,18 @@ static void P_3dMovement(player_t *player)
else
movepushangle = player->mo->angle;
}
movepushsideangle = movepushangle-ANGLE_90;
// cmomx/cmomy stands for the conveyor belt speed.
if (player->onconveyor == 2) // Wind/Current
{
//if (player->mo->z > player->mo->watertop || player->mo->z + player->mo->height < player->mo->waterbottom)
if (!(player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)))
player->cmomx = player->cmomy = 0;
}
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
player->cmomx = player->cmomy = 0;
else if (player->onconveyor != 2 && player->onconveyor != 4
&& player->onconveyor != 1
)
else if (player->onconveyor != 2 && player->onconveyor != 4 && player->onconveyor != 1)
player->cmomx = player->cmomy = 0;
player->rmomx = player->mo->momx - player->cmomx;
@@ -1939,29 +1938,8 @@ static void P_3dMovement(player_t *player)
if (dangle > ANGLE_180) //flip to keep to one side
{
dangle = InvAngle(dangle);
//dangleflip = true;
}
// anything else will leave both at 0, so no need to do anything else
//{ SRB2kart 220217 - Toaster Code for misplaced thrust
/*
if (!player->kartstuff[k_drift]) // Not Drifting
{
angle_t difference = dangle/2;
boolean reverse = (dangle >= ANGLE_90);
if (dangleflip)
difference = InvAngle(difference);
if (reverse)
difference += ANGLE_180;
P_InstaThrust(player->mo, player->mo->angle + difference, player->speed);
}
*/
//}
// When sliding, don't allow forward/back
if (player->pflags & PF_SLIDING)
cmd->forwardmove = 0;
@@ -1975,16 +1953,12 @@ static void P_3dMovement(player_t *player)
// Forward movement
if (!((player->exiting || mapreset) || (P_PlayerInPain(player) && !onground)))
{
//movepushforward = cmd->forwardmove * (thrustfactor * acceleration);
movepushforward = K_3dKartMovement(player, onground, cmd->forwardmove);
// allow very small movement while in air for gameplay
if (!onground)
movepushforward >>= 2; // proper air movement
// don't need to account for scale here with kart accel code
//movepushforward = FixedMul(movepushforward, player->mo->scale);
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
@@ -2051,9 +2025,11 @@ static void P_3dMovement(player_t *player)
// If "no" to 1, we're not reaching any limits yet, so ignore this entirely!
// -Shadow Hog
newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed)
{
fixed_t tempmomx, tempmomy;
if (oldMagnitude > K_GetKartSpeed(player, true) && onground) // SRB2Kart: onground check for air speed cap
{
if (newMagnitude > oldMagnitude)
@@ -2252,8 +2228,6 @@ static void P_MovePlayer(player_t *player)
{
player->pflags |= PF_FULLSTASIS;
// If you're in stasis in tag, you don't drown.
/*if (player->powers[pw_underwater] <= 12*TICRATE + 1)
P_RestoreMusic(player);*/
player->powers[pw_underwater] = player->powers[pw_spacetime] = 0;
}
}
@@ -2535,8 +2509,6 @@ static void P_DoZoomTube(player_t *player)
fixed_t dist;
boolean reverse;
//player->mo->height = P_GetPlayerSpinHeight(player);
if (player->speed > 0)
reverse = false;
else
@@ -2642,11 +2614,6 @@ static void P_DoZoomTube(player_t *player)
else if (player == &players[displayplayers[3]])
localangle[3] = player->mo->angle;
}
#if 0
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
player->frameangle -= ANGLE_22h;
#endif
}
//
@@ -2757,6 +2724,7 @@ boolean P_LookForEnemies(player_t *player)
continue; // not a mobj thinker
mo = (mobj_t *)think;
if (!(mo->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR|MF_SPRING)))
continue; // not a valid enemy
@@ -2822,14 +2790,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
fixed_t dist;
fixed_t ns = 0;
if (!enemy)
return;
if (!(enemy->health))
if (!enemy || !enemy->health)
return;
// change angle
source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y);
if (source->player)
{
if (source->player == &players[consoleplayer])
@@ -2882,6 +2848,7 @@ void P_FindEmerald(void)
continue;
mo2 = (mobj_t *)th;
if (mo2->type == MT_EMERHUNT)
{
if (!hunt1)
@@ -2902,9 +2869,6 @@ void P_FindEmerald(void)
//
static void P_DeathThink(player_t *player)
{
//ticcmd_t *cmd = &player->cmd;
//player->deltaviewheight = 0;
if (player->deadtimer < INT32_MAX)
player->deadtimer++;
@@ -4079,7 +4043,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (player->playerstate != PST_DEAD && !((player->pflags & PF_NIGHTSMODE) && player->exiting))
angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;'
if (twodlevel || (mo->flags2 & MF2_TWOD) || (!camstill && !timeover)) // Keep the view still...
if (!camstill && !timeover) // Keep the view still...
{
G_ClipAimingPitch((INT32 *)&angle);
@@ -5082,19 +5046,12 @@ void P_PlayerThink(player_t *player)
else
player->mo->flags2 &= ~MF2_DONTDRAW;
}
/*else if (player->mo->tracer)
{
if (player->powers[pw_flashing] & 1)
player->mo->tracer->flags2 |= MF2_DONTDRAW;
else
player->mo->tracer->flags2 &= ~MF2_DONTDRAW;
}*/
player->pflags &= ~PF_SLIDING;
K_KartPlayerThink(player, cmd); // SRB2kart
if (rendermode != render_none && cv_tilting.value)
if (cv_tilting.value && rendermode != render_none)
DoABarrelRoll(player);
LUA_HookPlayer(player, HOOK(PlayerThink));
@@ -5108,7 +5065,6 @@ void P_PlayerThink(player_t *player)
void P_PlayerAfterThink(player_t *player)
{
ticcmd_t *cmd;
//INT32 oldweapon = player->currentweapon; // SRB2kart - unused
camera_t *thiscam = NULL; // if not one of the displayed players, just don't bother
UINT8 i;
@@ -5170,11 +5126,10 @@ void P_PlayerAfterThink(player_t *player)
else if (cmd->forwardmove < 0 && player->mo->tracer->target->lastlook > player->mo->tracer->target->movecount)
player->mo->tracer->target->lastlook -= 2;
if (!(player->mo->tracer->target->flags & MF_SLIDEME) // Noclimb on chain parameters gives this
&& !(twodlevel || player->mo->flags2 & MF2_TWOD)) // why on earth would you want to turn them in 2D mode?
if (!(player->mo->tracer->target->flags & MF_SLIDEME)) // Noclimb on chain parameters gives this
{
player->mo->tracer->target->health += cmd->sidemove;
player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
player->mo->angle += cmd->sidemove << ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
if (player == &players[consoleplayer])
localangle[0] = player->mo->angle; // Adjust the local control angle.
@@ -5199,6 +5154,7 @@ void P_PlayerAfterThink(player_t *player)
// defaults to make sure 1st person cam doesn't do anything weird on startup
//player->deltaviewheight = 0;
player->viewheight = FixedMul(32 << FRACBITS, player->mo->scale);
if (player->mo->eflags & MFE_VERTICALFLIP)
player->viewz = player->mo->z + player->mo->height - player->viewheight;
else
+1 -4
View File
@@ -167,16 +167,13 @@ void R_InterpolateViewRollAngle(fixed_t frac)
void R_InterpolateView(fixed_t frac, boolean forceinvalid)
{
viewvars_t* prevview = oldview;
UINT8 i;
if (FIXED_TO_FLOAT(frac) < 0)
frac = 0;
if (frac > FRACUNIT)
frac = FRACUNIT;
i = R_GetViewNumber();
if (oldview_invalid[i] != 0 || forceinvalid)
if (oldview_invalid[R_GetViewNumber()] != 0 || forceinvalid)
{
// interpolate from newview to newview
prevview = newview;
-31
View File
@@ -1651,37 +1651,6 @@ void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
#undef WINMUMBLE
#endif // NOMUMBLE
//
// I_Tactile
//
void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
void I_Tactile3(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
void I_Tactile4(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
/** \brief empty ticcmd for player 1
*/
static ticcmd_t emptycmd;