fixed non-moving, high-velocity coconuts (#1627)

Coconuts were C4D_Object AND C4D_StaticBack. That meant that they would save speed (e.g. by explosions?) and could hit Clonks that passed by them.
install-platforms
David Dormagen 2017-12-29 09:55:11 +01:00
parent 91ff13b81f
commit 9214257424
1 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ private func GetHangingTime() { return 4200; }
public func AttachToTree(object tree)
{
SetCategory(GetCategory() | C4D_StaticBack);
SetCategory((GetCategory() | C4D_StaticBack) & (~C4D_Object));
mother = tree;
ScheduleCall(this, "DetachFromTree", 4200 + Random(500));
}
@ -25,7 +25,8 @@ public func AttachToTree(object tree)
public func DetachFromTree(bool no_bounce)
{
ClearScheduleCall(this, "DetachFromTree");
SetCategory(GetCategory() & (~C4D_StaticBack));
SetCategory((GetCategory() | C4D_Object) & (~C4D_StaticBack));
SetYDir(0);
SetXDir(Random(3)-1);
if (mother) mother->LostCoconut();
mother = nil;