mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 23:05:01 +08:00
Fixed Skeleton_setAttachment("slotname", 0).
This commit is contained in:
parent
7bfbf42494
commit
41cbe3bf3d
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user