Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
532 stars 140 forks source link

Calling #clone on certain classes such as Sprite or Window should raise TypeError #17

Open Ancurio opened 10 years ago

Ancurio commented 10 years ago

Need to compile a list of these classes first.

Exception message: "can't clone "

ReinUsesLisp commented 6 years ago

From RGSS1 (Ruby built-in classes were excluded): Plane, Sprite, Tilemap, Window, RPG::Sprite and Viewport raise TypeError.

RPG::Troop raises NameError in mkxp while in Game.exe is clonable.

Extraction method (using runtime scripts):

$string = ""
def test(klass, *args)
  $string += "#{klass}: "
  object = klass.new(*args)
  object.clone
  $string += "Clonable\n"
rescue => ex
  $string += "#{ex.class.to_s}\n"
end

test(Viewport, 0, 0, 1, 1)
test(Bitmap, 1, 1)
# ...

file = File.open($MKXP ? "output-mkxp" : "output-wine", "wb")
file.write($string)
file.close

Then just $ diff output-mkxp output-wine

I can't check RGSS2 and 3 right now, but this method should work too.