loam: disable free turning of Clonk

From bug report out of http://forum.openclonk.org/topic_show.pl?tid=3233
shapetextures
David Dormagen 2016-01-07 10:09:39 +01:00
parent e3553ca0cd
commit b6436783bb
1 changed files with 6 additions and 1 deletions

View File

@ -32,7 +32,10 @@ func ControlUseStart(object clonk, int x, int y)
}
// Add bridge effect and pass target coordinates.
AddEffect("IntBridge", clonk, 1, 1, this, nil, x, y);
// Make sure you can't turn the Clonk with left/right during construction.
var dir = DIR_Left;
if (x > 0) dir = DIR_Right;
clonk->SetTurnForced(dir);
return true;
}
@ -156,6 +159,8 @@ private func LoamDone(object clonk)
}
// Remove Effect
RemoveEffect("IntBridge", clonk);
// Allow Clonk to turn freely again.
clonk->SetTurnForced(-1);
// Remove loam object if most of it has been consumed
if (loamused > BridgeLength - 10)
RemoveObject();