Ruby: stop cpp_new from truncating vtable pointers

This fixes a crash in levers.rb, for instance.
develop
lethosor 2017-06-10 17:22:52 -04:00
parent 1321a64613
commit 65382473f7
1 changed files with 1 additions and 1 deletions

@ -138,7 +138,7 @@ module DFHack
def cpp_new(init=nil)
ptr = DFHack.malloc(_sizeof)
if _rtti_classname and vt = DFHack.rtti_getvtable(_rtti_classname)
DFHack.memory_write_int32(ptr, vt)
DFHack.memory_write_ptr(ptr, vt)
# TODO call constructor
end
o = new._at(ptr)