diff options
author | Steph Enders <smenders@gmail.com> | 2022-12-17 11:54:18 -0500 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-12-17 11:54:18 -0500 |
commit | 90909fb803e0c40a67b08cd41f6d0d447ee62f74 (patch) | |
tree | c3d2e010f0bd7cffdecf291f279505a536bd9fc8 /src | |
parent | 8e101f8bfd995321ac08a16fea9a171b549a0ae4 (diff) |
Fix door logic, off by 1 error
We were popping the door from the vector and then referencing it by it's
index which meant we'd always reference the WRONG door
Diffstat (limited to 'src')
-rw-r--r-- | src/CApi.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -236,9 +236,9 @@ static int c_open_door(lua_State *L) { can_open = true; // erase key lvl->heldKeys.erase(lvl->heldKeys.begin() + k); - lvl->doorPositions.erase(lvl->doorPositions.begin() + i); lvl->map[lvl->doorPositions[i].y][lvl->doorPositions[i].x] = BLANK_SPACE; + lvl->doorPositions.erase(lvl->doorPositions.begin() + i); break; } } |