- SW: Clean up old auto aim/mouse aim bits.

This commit is contained in:
Mitchell Richters 2021-01-01 22:37:40 +11:00
parent 949e456018
commit 3ec41e776c
5 changed files with 5 additions and 67 deletions

View file

@ -415,45 +415,12 @@ void InitLevel(MapRecord *maprec)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void InitPlayerGameSettings(void)
{
int pnum;
if (CommEnabled)
{
// everyone gets the same Auto Aim
TRAVERSE_CONNECT(pnum)
{
if (Autoaim(pnum))
SET(Player[pnum].Flags, PF_AUTO_AIM);
else
RESET(Player[pnum].Flags, PF_AUTO_AIM);
}
}
else
{
if (Autoaim(myconnectindex))
SET(Player[myconnectindex].Flags, PF_AUTO_AIM);
else
RESET(Player[myconnectindex].Flags, PF_AUTO_AIM);
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitRunLevel(void) void InitRunLevel(void)
{ {
Mus_Stop(); Mus_Stop();
DoTheCache(); DoTheCache();
// auto aim / auto run / etc
InitPlayerGameSettings();
// send packets with player info // send packets with player info
InitNetPlayerOptions(); InitNetPlayerOptions();

View file

@ -1013,7 +1013,6 @@ enum
PF_LOCK_CRAWL = (BIT(4)), PF_LOCK_CRAWL = (BIT(4)),
PF_PLAYER_MOVED = (BIT(7)), PF_PLAYER_MOVED = (BIT(7)),
PF_PLAYER_RIDING = (BIT(8)), PF_PLAYER_RIDING = (BIT(8)),
PF_AUTO_AIM = (BIT(9)),
PF_RECOIL = (BIT(10)), PF_RECOIL = (BIT(10)),
PF_FLYING = (BIT(11)), PF_FLYING = (BIT(11)),
PF_WEAPON_RETRACT = (BIT(12)), PF_WEAPON_RETRACT = (BIT(12)),
@ -1032,7 +1031,6 @@ enum
PF_VIEW_OUTSIDE_WEAPON = (BIT(27)), PF_VIEW_OUTSIDE_WEAPON = (BIT(27)),
PF_VIEW_FROM_CAMERA = (BIT(28)), PF_VIEW_FROM_CAMERA = (BIT(28)),
PF_TANK = (BIT(29)), // Doin the tank thang PF_TANK = (BIT(29)), // Doin the tank thang
PF_MOUSE_AIMING_ON = (BIT(30)),
PF_WEAPON_DOWN = (BIT(31)), PF_WEAPON_DOWN = (BIT(31)),
PF2_TELEPORTED = (BIT(0)), PF2_TELEPORTED = (BIT(0)),
PF2_INPUT_CAN_AIM = (BIT(1)), // Allow calling DoPlayerHorizon() from processMovement() PF2_INPUT_CAN_AIM = (BIT(1)), // Allow calling DoPlayerHorizon() from processMovement()

View file

@ -73,33 +73,6 @@ enum
}; };
#endif #endif
//---------------------------------------------------------------------------
//
// handles the input bits
//
//---------------------------------------------------------------------------
static void processInputBits(PLAYERp const pp, ControlInfo* const hidInput)
{
ApplyGlobalInput(loc, hidInput);
if (!CommEnabled)
{
// Go back to the source to set this - the old code here was catastrophically bad.
// this needs to be fixed properly - as it is this can never be compatible with demo playback.
if (!(loc.actions & SB_AIMMODE))
SET(Player[myconnectindex].Flags, PF_MOUSE_AIMING_ON);
else
RESET(Player[myconnectindex].Flags, PF_MOUSE_AIMING_ON);
if (Autoaim(myconnectindex))
SET(Player[myconnectindex].Flags, PF_AUTO_AIM);
else
RESET(Player[myconnectindex].Flags, PF_AUTO_AIM);
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// handles movement // handles movement
@ -199,7 +172,7 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
InputPacket input {}; InputPacket input {};
PLAYERp pp = &Player[myconnectindex]; PLAYERp pp = &Player[myconnectindex];
processInputBits(pp, hidInput); ApplyGlobalInput(loc, hidInput);
processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.); processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.);
processWeapon(pp); processWeapon(pp);

View file

@ -1672,7 +1672,7 @@ PlayerAutoLook(PLAYERp pp, double const scaleAdjust)
if (!TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)) if (!TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING))
{ {
if (!TEST(pp->Flags, PF_MOUSE_AIMING_ON) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE)) // If the floor is sloped if ((pp->input.actions & SB_AIMMODE) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE)) // If the floor is sloped
{ {
// Get a point, 512 units ahead of player's position // Get a point, 512 units ahead of player's position
x = pp->posx + pp->angle.ang.bcos(-5); x = pp->posx + pp->angle.ang.bcos(-5);

View file

@ -14306,7 +14306,7 @@ WeaponAutoAim(SPRITEp sp, short Missile, short ang, bool test)
if (u && u->PlayerP) if (u && u->PlayerP)
{ {
if (!TEST(u->PlayerP->Flags, PF_AUTO_AIM)) if (!Autoaim(u->PlayerP->pnum))
{ {
return -1; return -1;
} }
@ -14376,7 +14376,7 @@ WeaponAutoAimZvel(SPRITEp sp, short Missile, int *zvel, short ang, bool test)
if (u && u->PlayerP) if (u && u->PlayerP)
{ {
if (!TEST(u->PlayerP->Flags, PF_AUTO_AIM)) if (!Autoaim(u->PlayerP->pnum))
{ {
return -1; return -1;
} }
@ -14495,7 +14495,7 @@ WeaponAutoAimHitscan(SPRITEp sp, int *z, short *ang, bool test)
if (u && u->PlayerP) if (u && u->PlayerP)
{ {
if (!TEST(u->PlayerP->Flags, PF_AUTO_AIM)) if (!Autoaim(u->PlayerP->pnum))
{ {
return -1; return -1;
} }