prevent floor switch from making object stuck while moving

master
Maikel de Vries 2018-02-28 10:35:17 +01:00
parent a023b63fda
commit a2d7374302
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ public func CheckObjects()
for (var obj in obj_on_switch)
obj->SetPosition(obj->GetX(), obj->GetY() + change);
SetPosition(GetX(), GetY() + change);
// Do not make objects stuck.
for (var obj in obj_on_switch)
if (obj->Stuck())
obj->SetPosition(obj->GetX(), obj->GetY() - change);
y_position += change;
// Do moving of target door or perform user actions.
if (y_position == desired_y)