Fixed cocos2d bounding box crash.

This commit is contained in:
NathanSweet 2013-04-16 16:43:04 +02:00
parent 3df36416c5
commit 925bad7a64

View File

@ -354,7 +354,7 @@ char* _Util_readFile (const char* path, int* length) {
for (int i = 0; i < skeleton->slotCount; ++i) {
Slot* slot = skeleton->slots[i];
Attachment* attachment = slot->attachment;
if (attachment->type != ATTACHMENT_REGION) continue;
if (attachment && attachment->type != ATTACHMENT_REGION) continue;
Cocos2dRegionAttachment* regionAttachment = SUB_CAST(Cocos2dRegionAttachment, attachment);
minX = fmin(minX, regionAttachment->quad.bl.vertices.x);
minY = fmin(minY, regionAttachment->quad.bl.vertices.y);