fixed treadmills with PD2 and made it default again

This commit is contained in:
Reonu
2021-08-06 02:20:12 +01:00
parent 41a3489e3e
commit 25341d14d1
2 changed files with 10 additions and 2 deletions

View File

@@ -84,8 +84,8 @@
//#define NO_FALL_DAMAGE_SOUND
// Number of coins to spawn the "100 coin" star. If you remove the define altogether, then there won't be a 100 coin star at all.
#define X_COIN_STAR 100
// Platform displacement 2 also known as momentum patch. Makes Mario keep the momemtum from moving platforms. Breaks treadmills.
//#define PLATFORM_DISPLACEMENT_2
// Platform displacement 2 also known as momentum patch. Makes Mario keep the momemtum from moving platforms. Doesn't break treadmills anymore!
#define PLATFORM_DISPLACEMENT_2
// Stars don't kick you out of the level
// #define NON_STOP_STARS
// Uncomment this if you want global star IDs (useful for creating an open world hack ala MVC)

View File

@@ -144,6 +144,14 @@ void apply_platform_displacement(struct PlatformDisplacementInfo *displaceInfo,
vec3f_sub(pos, platformPos);
}
if (platformPos[0] == platform->oPosX
&& platformPos[1] == platform->oPosY
&& platformPos[2] == platform->oPosZ) {
pos[0] += platform->oVelX;
pos[1] += platform->oVelY;
pos[2] += platform->oVelZ;
}
// Transform from world positions to relative positions for use next frame
linear_mtxf_transpose_mul_vec3f(*platform->header.gfx.throwMatrix, scaledPos, pos);
scale_vec3f(displaceInfo->prevTransformedPos, scaledPos, platform->header.gfx.scale, TRUE);