summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-10 11:18:36 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-10 11:18:36 -0500
commit8a39ba20ad46092b5242a44b103814136edcf025 (patch)
tree1f11f07ca1eb46c424a0fe82d8ea1058025b7241
parent5931470800c43260f600303d1231dbaf586f26fc (diff)
downloadtanetane-8a39ba20ad46092b5242a44b103814136edcf025.tar.gz
tanetane-8a39ba20ad46092b5242a44b103814136edcf025.tar.bz2
tanetane-8a39ba20ad46092b5242a44b103814136edcf025.zip
Fixed issue with walking vertically into solid sprites
-rw-r--r--src/transform_system.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/transform_system.cpp b/src/transform_system.cpp index 8a09c20..6ed6210 100644 --- a/src/transform_system.cpp +++ b/src/transform_system.cpp
@@ -141,9 +141,9 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire
141 newColUL.x() <= it->second.upper) { 141 newColUL.x() <= it->second.upper) {
142 int colliderSpriteId = std::get<1>(it->first); 142 int colliderSpriteId = std::get<1>(it->first);
143 Sprite& collider = game_.getSprite(colliderSpriteId); 143 Sprite& collider = game_.getSprite(colliderSpriteId);
144 result.horiz.blocked = collider.solid; 144 result.vert.blocked = collider.solid;
145 result.horiz.dir = Direction::down; 145 result.vert.dir = Direction::down;
146 result.horiz.colliderSprite = colliderSpriteId; 146 result.vert.colliderSprite = colliderSpriteId;
147 147
148 break; 148 break;
149 } 149 }
@@ -173,9 +173,9 @@ CollisionResult TransformSystem::checkCollision(int spriteId, vec2i newLoc, Dire
173 newColUL.x() <= it->second.upper) { 173 newColUL.x() <= it->second.upper) {
174 int colliderSpriteId = std::get<1>(it->first); 174 int colliderSpriteId = std::get<1>(it->first);
175 Sprite& collider = game_.getSprite(colliderSpriteId); 175 Sprite& collider = game_.getSprite(colliderSpriteId);
176 result.horiz.blocked = collider.solid; 176 result.vert.blocked = collider.solid;
177 result.horiz.dir = Direction::up; 177 result.vert.dir = Direction::up;
178 result.horiz.colliderSprite = colliderSpriteId; 178 result.vert.colliderSprite = colliderSpriteId;
179 179
180 break; 180 break;
181 } 181 }