Don't accidentally reattach coconuts (#1858)

I'm not sure how exactly that issue happens, but in the attached video
it looks like C4D_StaticBack was accidentally set again. As the XOR
operation can do that, I'm changing it to always set the C4D_StaticBack
bit to 0.
install-platforms
Lukas Werling 2017-12-26 20:00:32 +01:00
parent 31fee7a46d
commit a4f25ecd4c
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ public func AttachToTree(object tree)
public func DetachFromTree(bool no_bounce)
{
ClearScheduleCall(this, "DetachFromTree");
SetCategory(GetCategory() ^ C4D_StaticBack);
SetCategory(GetCategory() & (~C4D_StaticBack));
SetXDir(Random(3)-1);
if (mother) mother->LostCoconut();
mother = nil;