Mann mann mann, das hat mich jetzt gut und gerne eine halbe Stunde gekostet

Auch das Verschieben nach rechts führt nämlich ab x=19 zu dem Fehler.
Wenigstens ist das ein super Beispiel dafür, welche bescheuerten Programmier-Angewohnheiten es zu vermeiden gilt (obwohl es in diesem Fall fast verzeihbar ist).
In der rep_ex fand ich dies hier:
if (game.top_inv_item > 0)
{
// if inventory can scroll up
SetButtonPic (MAINGUI, 9, 1, invUparrowONsprite);
if (GetInvAt (180, 160) < 0) game.top_inv_item = game.top_inv_item - (game.num_inv_displayed / 2 ); //160,180 coords of the 1st inv. slot
}
Wie man sieht, verwendet der Check absolute Koordinaten. Wenn man also stattdessen dieses benutzt:
if (GetInvAt (gui[MAINGUI].X+gui[MAINGUI].Controls[11].X+2, gui[MAINGUI].Y+gui[MAINGUI].Controls[11].Y+2) < 0)
game.top_inv_item = game.top_inv_item - (game.num_inv_displayed / 2 ); // coords of the 1st inv. slot
sollte es klappen.