SpriteのクラスメソッドでSprite以外のオブジェクトの動作がバグっていたので修正
@@ -1041,20 +1041,13 @@ | ||
1041 | 1041 | { |
1042 | 1042 | Sprite_class_update( cSprite, p ); |
1043 | 1043 | } |
1044 | - else if( rb_respond_to( p, id_vanished ) ) | |
1044 | + else if( !rb_respond_to( p, id_vanished ) || !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1045 | 1045 | { |
1046 | - if( !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1046 | + if( rb_respond_to( p, id_update ) ) | |
1047 | 1047 | { |
1048 | - if( rb_respond_to( p, id_update ) ) | |
1049 | - { | |
1050 | - rb_funcall2( p, id_update, 0, 0 ); | |
1051 | - } | |
1048 | + rb_funcall2( p, id_update, 0, 0 ); | |
1052 | 1049 | } |
1053 | 1050 | } |
1054 | - else if( rb_respond_to( p, id_update ) ) | |
1055 | - { | |
1056 | - rb_funcall2( p, id_update, 0, 0 ); | |
1057 | - } | |
1058 | 1051 | } |
1059 | 1052 | return Qnil; |
1060 | 1053 | } |
@@ -1077,23 +1070,10 @@ | ||
1077 | 1070 | { |
1078 | 1071 | Sprite_class_draw( cSprite, p ); |
1079 | 1072 | } |
1080 | - else if( rb_respond_to( p, id_vanished ) ) | |
1073 | + else if( !rb_respond_to( p, id_vanished ) || !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1081 | 1074 | { |
1082 | - if( !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1075 | + if( !rb_respond_to( p, id_visible ) || RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) ) | |
1083 | 1076 | { |
1084 | - if( rb_respond_to( p, id_visible ) && RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) ) | |
1085 | - { | |
1086 | - if( rb_respond_to( p, id_draw ) ) | |
1087 | - { | |
1088 | - rb_funcall2( p, id_draw, 0, 0 ); | |
1089 | - } | |
1090 | - } | |
1091 | - } | |
1092 | - } | |
1093 | - else if( rb_respond_to( p, id_visible ) ) | |
1094 | - { | |
1095 | - if( RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) ) | |
1096 | - { | |
1097 | 1077 | if( rb_respond_to( p, id_draw ) ) |
1098 | 1078 | { |
1099 | 1079 | rb_funcall2( p, id_draw, 0, 0 ); |
@@ -1100,10 +1080,6 @@ | ||
1100 | 1080 | } |
1101 | 1081 | } |
1102 | 1082 | } |
1103 | - else if( rb_respond_to( p, id_draw ) ) | |
1104 | - { | |
1105 | - rb_funcall2( p, id_draw, 0, 0 ); | |
1106 | - } | |
1107 | 1083 | } |
1108 | 1084 | return Qnil; |
1109 | 1085 | } |
@@ -1126,12 +1102,9 @@ | ||
1126 | 1102 | { |
1127 | 1103 | Sprite_class_clean( cSprite, p ); |
1128 | 1104 | } |
1129 | - else if( rb_respond_to( p, id_vanished ) ) | |
1105 | + else if( rb_respond_to( p, id_vanished ) && RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1130 | 1106 | { |
1131 | - if( RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) | |
1132 | - { | |
1133 | - RARRAY_ASET( ary, i, Qnil); | |
1134 | - } | |
1107 | + RARRAY_ASET( ary, i, Qnil); | |
1135 | 1108 | } |
1136 | 1109 | } |
1137 | 1110 |