Animal: fix not goinf in dropping mode when dragged to right side of display

This commit is contained in:
jettis
2024-12-06 13:16:50 +02:00
parent ca423994ea
commit a36a62761a

View File

@@ -235,13 +235,13 @@ void Animal::move() {
// Don't go out of display on right side // Don't go out of display on right side
if (disp_pos.x + getImage()->w > disp_pos.w) { if (disp_pos.x + getImage()->w > disp_pos.w) {
setSpecialState(stay); setSpecialState(stay);
if (disp_pos.y < getImage()->h - 150) { if (disp_pos.y < disp_pos.h - 150) {
setSpecialState(drop); setSpecialState(drop);
} }
disp_pos.x = disp_pos.w - getImage()->w - 2; disp_pos.x = disp_pos.w - getImage()->w - 2;
} }
// Donät fo out of display on left side // Don't go out of display on left side
if (disp_pos.x < 0) { if (disp_pos.x < 0) {
setSpecialState(stay); setSpecialState(stay);
if (disp_pos.y < disp_pos.h - 150) { if (disp_pos.y < disp_pos.h - 150) {