summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shyguy.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index 32928c0..140501a 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -657,7 +657,7 @@ int daShyGuy::onCreate() {
_324 = 16.0f;
// These structs tell stupid collider what to collide with - these are from koopa troopa
- static const lineSensor_s below(-6<<12, 6<<12, 0<<12);
+ static const lineSensor_s below(-5<<12, 5<<12, 0<<12);
static const pointSensor_s above(0<<12, 12<<12);
static const lineSensor_s adjacent(6<<12, 9<<12, 6<<12);
@@ -1227,17 +1227,36 @@ bool daShyGuy::willWalkOntoSuitableGround() {
void daShyGuy::executeState_RealWalk() {
chrAnimation.setUpdateRate(1.5f);
+ // if (distance) {
+ // // What the fuck. Somehow, having this code makes the shyguy not
+ // // fall through solid-on-top platforms...
+ // bool turn = collMgr.isOnTopOfTile();
+ // if (!turn) {
+ // if (!stillFalling) {
+ // stillFalling = true;
+ // pos.x = direction ? pos.x + 1.5 : pos.x - 1.5;
+ // doStateChange(&StateID_RealTurn);
+ // }
+ // } else
+ // }
+
+
if (distance) {
- // What the fuck. Somehow, having this code makes the shyguy not
- // fall through solid-on-top platforms...
- bool turn = collMgr.isOnTopOfTile();
- if (!turn) {
+ if (collMgr.isOnTopOfTile()) {
+ stillFalling = false;
+
+ if (!willWalkOntoSuitableGround()) {
+ pos.x = direction ? pos.x + 1.5 : pos.x - 1.5;
+ doStateChange(&StateID_RealTurn);
+ }
+ }
+ else {
if (!stillFalling) {
stillFalling = true;
pos.x = direction ? pos.x + 1.5 : pos.x - 1.5;
doStateChange(&StateID_RealTurn);
}
- } else stillFalling = false;
+ }
}
bool ret = calculateTileCollisions();
@@ -1245,15 +1264,6 @@ bool daShyGuy::willWalkOntoSuitableGround() {
doStateChange(&StateID_RealTurn);
}
- if (distance) {
- if (collMgr.isOnTopOfTile()) {
- if (!willWalkOntoSuitableGround()) {
- pos.x = direction ? pos.x + 1.5 : pos.x - 1.5;
- doStateChange(&StateID_RealTurn);
- }
- }
- }
-
if(this->chrAnimation.isAnimationDone()) {
this->chrAnimation.setCurrentFrame(0.0);
}