convert lua_ref from lua::Table to int (reference), fix a bug in statedata_changerequest