forked from Ports/perfect_dark
Look ahead
This commit is contained in:
1 parent
fa7ef3df64
commit
23ce248dce
1 file changed
+21
@@ -1833,7 +1833,12 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
if (controlmode == CONTROLMODE_12 || controlmode == CONTROLMODE_14 || controlmode == CONTROLMODE_PC) {
|
||||
#else
|
||||
// The PC controls walk with an analog stick like 1.1, so look ahead works there (see below)
|
||||
if (controlmode == CONTROLMODE_12 || controlmode == CONTROLMODE_14) {
|
||||
#endif
|
||||
movedata.disablelookahead = true;
|
||||
}
|
||||
} // end 1.x
|
||||
@@ -1992,6 +1997,22 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
lookahead = g_Vars.currentplayer->cachedlookahead;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
// PC controls pitch with the right stick or mouse (natural pitch), which the N64 code never
|
||||
// treats as manual pitch. Do what C-up/C-down does: stop the centring until the next walk,
|
||||
// or until the walk stops if already walking.
|
||||
// A deliberate stick deflection only: a resting stick can drift past the small dead zone
|
||||
if (controlmode == CONTROLMODE_PC
|
||||
&& (movedata.analogpitch > 15 || movedata.analogpitch < -15 || movedata.freelookdy != 0.0f)) {
|
||||
g_Vars.currentplayer->docentreupdown = false;
|
||||
g_Vars.currentplayer->automovecentre = false;
|
||||
|
||||
if (movedata.canlookahead && (movedata.analogwalk > 60 || movedata.analogwalk < -60)) {
|
||||
g_Vars.currentplayer->movecentrerelease = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_Vars.currentplayer->movecentrerelease
|
||||
&& movedata.analogwalk < 40 && movedata.analogwalk > -40) {
|
||||
g_Vars.currentplayer->movecentrerelease = false;
|
||||
|
||||
Reference in new issue
Block a user