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