Skip to content

Commit

Permalink
Merge pull request #576 from lpenguin/fix-575
Browse files Browse the repository at this point in the history
Fixed segmentation fault in the Barrier
  • Loading branch information
stalkerg authored May 10, 2022
2 parents cbf830a + cb61426 commit c83be0c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/dast/poly3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,18 +1014,16 @@ void dastPutSpriteOnMapAlt(int x, int y, uchar *data, int x_size, int y_size, un

void dastPutSandOnMapAlt(int x, int y, uchar _z, uchar newter, uchar wide){
uchar **lt = vMap -> lineT;
int i, j;
uchar _d = 82;
newter <<= TERRAIN_OFFSET;

int x_size = wide;
int y_size = wide;

for( i = y - (y_size>>1); i < y + (y_size>>1); i++)
for(int i = y - (y_size>>1); i <= y + (y_size>>1); i++){
if (!lt[(i) & clip_mask_y]) return;

for( i = y - (y_size>>1); i <= y + (y_size>>1); i++)
for( j = x - (x_size>>1); j <= x + (x_size>>1); j++){
for(int j = x - (x_size>>1); j <= x + (x_size>>1); j++){
//uchar *lc = get_down_ground( (j) & clip_mask_x, i );
//uchar *lc = (*pf)( (j) & clip_mask_x, i );
uchar *lc = get_up_ground( (j) & clip_mask_x, i );
Expand All @@ -1043,6 +1041,7 @@ void dastPutSandOnMapAlt(int x, int y, uchar _z, uchar newter, uchar wide){
*(lc + H_SIZE) += newter;
}
}
}
}
regRender(x - (x_size>>1), y - (y_size>>1), x + (x_size>>1), y + (y_size>>1), 0);
}

0 comments on commit c83be0c

Please sign in to comment.