From 41cbe3bf3d72e23ec67a22e30d5dead0b9c6a8e6 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 24 Jun 2013 16:24:50 +0200 Subject: [PATCH] Fixed Skeleton_setAttachment("slotname", 0). --- spine-c/src/spine/Skeleton.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spine-c/src/spine/Skeleton.c b/spine-c/src/spine/Skeleton.c index 418d927df..6892200c6 100644 --- a/spine-c/src/spine/Skeleton.c +++ b/spine-c/src/spine/Skeleton.c @@ -184,9 +184,13 @@ int Skeleton_setAttachment (Skeleton* self, const char* slotName, const char* at for (i = 0; i < self->slotCount; ++i) { Slot *slot = self->slots[i]; if (strcmp(slot->data->name, slotName) == 0) { - Attachment* attachment = Skeleton_getAttachmentForSlotIndex(self, i, attachmentName); - if (!attachment) return 0; - Slot_setAttachment(slot, attachment); + if (!attachmentName) + Slot_setAttachment(slot, 0); + else { + Attachment* attachment = Skeleton_getAttachmentForSlotIndex(self, i, attachmentName); + if (!attachment) return 0; + Slot_setAttachment(slot, attachment); + } return 1; } }