Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* rocks.c (init_buckets): oops, we weren't allocating big enough arrays.
[vor.git]
/
rocks.c
diff --git
a/rocks.c
b/rocks.c
index
a594547
..
0a71ebf
100644
(file)
--- a/
rocks.c
+++ b/
rocks.c
@@
-56,8
+56,10
@@
bucket(int x, int y, int p)
void
init_buckets(void)
{
void
init_buckets(void)
{
- bw = (XSIZE+2*grid_size-1) / grid_size;
- bh = (YSIZE+2*grid_size-1) / grid_size;
+ int scr_grid_w = (XSIZE+2*grid_size-1) / grid_size;
+ int scr_grid_h = (YSIZE+2*grid_size-1) / grid_size;
+ bw = 1 + scr_grid_w + 1;
+ bh = 1 + scr_grid_h + 1;
n_buckets = bw * bh;
rock_buckets[0] = malloc(n_buckets * sizeof(struct rock_struct *));
n_buckets = bw * bh;
rock_buckets[0] = malloc(n_buckets * sizeof(struct rock_struct *));