mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 11:01:01 +00:00
- Duke: Clean up player/actor accesses in underwater()
.
This commit is contained in:
parent
5d628d712c
commit
a51521381f
4 changed files with 8 additions and 7 deletions
|
@ -236,7 +236,7 @@ void donewgame(MapRecord* map, int sk);
|
|||
int playercolor2lookup(int color);
|
||||
void PlayerColorChanged(void);
|
||||
bool movementBlocked(DDukePlayer *p);
|
||||
void underwater(int snum, ESyncBits actions, double floorz, double ceilingz);
|
||||
void underwater(DDukePlayer* p, ESyncBits actions, double floorz, double ceilingz);
|
||||
void loadcons();
|
||||
void DrawStatusBar();
|
||||
void thunder(void);
|
||||
|
|
|
@ -1568,8 +1568,10 @@ void playerkick(DDukePlayer* p, DDukeActor* g_ac)
|
|||
{
|
||||
if (ud.multimode > 1 && g_ac->isPlayer())
|
||||
{
|
||||
if (getPlayer(otherp)->quick_kick == 0)
|
||||
getPlayer(otherp)->quick_kick = 14;
|
||||
const auto p2 = getPlayer(otherp);
|
||||
|
||||
if (p2->quick_kick == 0)
|
||||
p2->quick_kick = 14;
|
||||
}
|
||||
else if (!g_ac->isPlayer() && p->quick_kick == 0)
|
||||
p->quick_kick = 14;
|
||||
|
@ -1581,9 +1583,8 @@ void playerkick(DDukePlayer* p, DDukeActor* g_ac)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void underwater(int snum, ESyncBits actions, double floorz, double ceilingz)
|
||||
void underwater(DDukePlayer* const p, ESyncBits actions, double floorz, double ceilingz)
|
||||
{
|
||||
const auto p = getPlayer(snum);
|
||||
const auto pact = p->GetActor();
|
||||
constexpr double dist = (348. / 256.);
|
||||
const auto kbdDir = ((actions & SB_JUMP) && !p->OnMotorcycle) - ((actions & SB_CROUCH) || p->OnMotorcycle);
|
||||
|
|
|
@ -1693,7 +1693,7 @@ void processinput_d(int snum)
|
|||
|
||||
if (psectlotag == ST_2_UNDERWATER)
|
||||
{
|
||||
underwater(snum, actions, floorz, ceilingz);
|
||||
underwater(p, actions, floorz, ceilingz);
|
||||
}
|
||||
else if (p->jetpack_on)
|
||||
{
|
||||
|
|
|
@ -2524,7 +2524,7 @@ void processinput_r(int snum)
|
|||
}
|
||||
if (psectlotag == ST_2_UNDERWATER)
|
||||
{
|
||||
underwater(snum, actions, floorz, ceilingz);
|
||||
underwater(p, actions, floorz, ceilingz);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue