shovel: symmetrize dig angle limits

epoxy
Maikel de Vries 2016-01-31 09:59:41 +01:00
parent eb1750a7d3
commit 273c574dc0
1 changed files with 4 additions and 4 deletions

View File

@ -136,10 +136,10 @@ public func FxShovelDigTimer(object clonk, effect, int time)
var speed = clonk.ActMap.Dig.Speed*2;
speed = this->GetModifiedDigSpeed(clonk, speed);
// limit angle
DigAngle = BoundBy(DigAngle,65,300);
var dig_xdir = Sin(DigAngle,+speed);
var dig_ydir = Cos(DigAngle,-speed);
// Limit the digging angle: one can dig maximally 30 degrees upwards.
DigAngle = BoundBy(DigAngle, 60, 300);
var dig_xdir = Sin(DigAngle, speed);
var dig_ydir = -Cos(DigAngle, speed);
// Stuck-check: When player wants to go horizontally while standing on the ground but can't, add a vertical redirect
// This helps with Clonks getting "stuck" not moving on certain terrain when dig speed is not sufficient to push him up a slope