Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is now possible to step on the goblin to kill it. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chipot
Copy link

@chipot chipot commented Oct 17, 2018

No description provided.

Copy link
Owner

@tleguern tleguern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😄 A few details to tweak and it will be good to go.

@@ -58,7 +58,7 @@ cave_reduce_noise(struct level *l, struct level *tmp) {
unsigned int nwall = 0;
for (iy = -1; iy <= 1; ++iy)
for (ix = -1; ix <= 1; ++ix)
if (l->tile[y + iy][x + ix].type \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already removed on master branch.

return(-1);
}
if (c->x + col < 0 || c->x + col >= COLS) {
if (nx < 0 || nx >= COLS) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug in my code, I should have used MAXROWS and MAXCOLS which represent the size of the map instead of LINES and COLS which represents the size of the screen.

return(-1);
}
if (tile_is_wall(&(l->tile[c->y + row][c->x + col]))) {

struct tile const* nt = &l->tile[ny][nx];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if it's allowed now I would prefer to keep variable declarations at the top of each block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants