With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Water-ladder-bug and out-of-water-climbing fix

Postby TheDoctor » Tue Oct 26, 2010 2:47 pm

in code/game/bg_pmove.c in void PmoveSingle (pmove_t *pmove), one should switch the order of the cases (pml.ladder) and (pm->waterlevel>1). This fixes the bug where you are stuck for some time at ladders when coming out of water, like the one in dm_canyon (beneath the toilet).
Code: Select all
    } else if (pml.ladder) { // ladder takes precedence over swimming
        PM_LadderMove();
    } else if ( pm->waterlevel > 1 ) {
        // swimming
        PM_WaterMove();

To allow the player climb out of the water, change in code/game/bg_pmove.c in void CheckLadder( void ):
Code: Select all
    if ((trace.fraction < 1) && ((trace.surfaceFlags & SURF_LADDER) || ( pm->waterlevel > 0.75))){

instead of
Code: Select all
    if ((trace.fraction < 1) && (trace.surfaceFlags & SURF_LADDER)){

To climb out of the water it suffices to move forward (and to look down, in case you need to rectract your head a bit). You may test this at BB.
User avatar
TheDoctor
Smokin' Amigo!
 
Posts: 818
Joined: Sun Jun 06, 2010 3:31 am



Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron