Sprite#offset_sync=trueの場合のエラーチェックがおかしかったので修正
@@ -1222,10 +1222,18 @@ | ||
1222 | 1222 | if( RTEST(sprite->voffset_sync) ) |
1223 | 1223 | { |
1224 | 1224 | struct DXRubyImage *image; |
1225 | - DXRUBY_CHECK_IMAGE( sprite->vimage ); | |
1226 | - image = DXRUBY_GET_STRUCT( Image, sprite->vimage ); | |
1227 | - collision->base_x -= (sprite->vcenter_x == Qnil ? image->width / 2 : NUM2FLOAT(sprite->vcenter_x)); | |
1228 | - collision->base_y -= (sprite->vcenter_y == Qnil ? image->height / 2 : NUM2FLOAT(sprite->vcenter_y)); | |
1225 | + if( sprite->vcenter_x == Qnil || sprite->vcenter_y == Qnil ) | |
1226 | + { | |
1227 | + DXRUBY_CHECK_IMAGE( sprite->vimage ); | |
1228 | + image = DXRUBY_GET_STRUCT( Image, sprite->vimage ); | |
1229 | + collision->base_x -= sprite->vcenter_x == Qnil ? image->width / 2 : NUM2FLOAT(sprite->vcenter_x); | |
1230 | + collision->base_y -= sprite->vcenter_y == Qnil ? image->height / 2 : NUM2FLOAT(sprite->vcenter_y); | |
1231 | + } | |
1232 | + else | |
1233 | + { | |
1234 | + collision->base_x -= NUM2FLOAT(sprite->vcenter_x); | |
1235 | + collision->base_y -= NUM2FLOAT(sprite->vcenter_y); | |
1236 | + } | |
1229 | 1237 | } |
1230 | 1238 | collision->angle = NUM2FLOAT(sprite->vangle); |
1231 | 1239 | collision->scale_x = NUM2FLOAT(sprite->vscale_x); |