projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with using too large scroll delay value on smaller playfields
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index c7589cf005057b7a46c2fd1ec22ad7ba36d59a08..ad2f231f641f92cc86eb124e2e8a91c4eed6eede 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-12532,10
+12532,11
@@
boolean MovePlayer(struct PlayerInfo *player, int dx, int dy)
}
else
{
}
else
{
- int offset = game.scroll_delay_value;
+ int offset
_raw
= game.scroll_delay_value;
if (jx != old_jx) // player has moved horizontally
{
if (jx != old_jx) // player has moved horizontally
{
+ int offset = MIN(offset_raw, (SCR_FIELDX - 2) / 2);
int offset_x = offset * (player->MovDir == MV_LEFT ? +1 : -1);
int new_scroll_x = jx - MIDPOSX + offset_x;
int offset_x = offset * (player->MovDir == MV_LEFT ? +1 : -1);
int new_scroll_x = jx - MIDPOSX + offset_x;
@@
-12556,6
+12557,7
@@
boolean MovePlayer(struct PlayerInfo *player, int dx, int dy)
}
else // player has moved vertically
{
}
else // player has moved vertically
{
+ int offset = MIN(offset_raw, (SCR_FIELDY - 2) / 2);
int offset_y = offset * (player->MovDir == MV_UP ? +1 : -1);
int new_scroll_y = jy - MIDPOSY + offset_y;
int offset_y = offset * (player->MovDir == MV_UP ? +1 : -1);
int new_scroll_y = jy - MIDPOSY + offset_y;