From 7b7c7b2dc785a75af7c47c13d446cc6e93a77e67 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 5 Oct 2020 23:13:07 -0700 Subject: [PATCH] Fix inconsistencies with y-positions of spawns It seems like the start point of a custom level and all checkpoints in the game end up putting your spawn point one pixel away from the surface it touches, which seems like an oversight. I'm going to enforce some consistency here and make it so that all spawn points, whenever you start from a start point or a checkpoint, will always be correctly positioned flush with the surface they're standing on, and not one pixel more or less than that. --- desktop_version/src/Entity.cpp | 4 ++-- desktop_version/src/editor.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index d227343e..aaffa92b 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -2619,12 +2619,12 @@ bool entityclass::updateentities( int i ) if (entities[i].tile == 20) { - game.savey = entities[i].yp - 1; + game.savey = entities[i].yp - 2; game.savegc = 1; } else if (entities[i].tile == 21) { - game.savey = entities[i].yp-8; + game.savey = entities[i].yp - 7; game.savegc = 0; } diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 7b466241..cda9edc6 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -1526,7 +1526,7 @@ void editorclass::findstartpoint() game.edsaverx = 100+tx; game.edsavery = 100+ty; game.edsavegc = 0; - game.edsavey--; + game.edsavey++; game.edsavedir=1-edentity[testeditor].p1; } } @@ -4719,12 +4719,13 @@ void editorinput() if (edentity[testeditor].p1 == 0) // NOT a bool check! { game.edsavegc = 1; + game.edsavey -= 2; } else { game.edsavegc = 0; + game.edsavey -= 7; } - game.edsavey--; game.edsavedir = 0; } else @@ -4737,7 +4738,7 @@ void editorinput() game.edsaverx = 100+tx; game.edsavery = 100+ty; game.edsavegc = 0; - game.edsavey--; + game.edsavey++; game.edsavedir=1-edentity[testeditor].p1; }