def copy_weapon(from, to)
d = load_data("Data/Weapons.rxdata")
c = load_data("Data/Classes.rxdata")
d[to]=d[from].clone
d[to].id = to
c.each do |cl|
next if cl.nil?
cl.weapon_set.push(to) if cl.weapon_set.include?(from)
end
filename = "Data/Weapons.rxdata"
filename1 = "Data/Classes.rxdata"
file = File.open(filename, "wb")
file1 = File.open(filename1, "wb")
Marshal.dump(d,file)
Marshal.dump(c,file1)
file.close
file1.close
$data_weapons = load_data(filename)
$data_classes = load_data(filename1)
end
def copy_weapon(from, to)
d = load_data("Data/Weapons.rxdata")
c = load_data("Data/Classes.rxdata")
d[to]=d[from].clone
d[to].id = to
c.each do |cl|
next if cl.nil?
cl.weapon_set.push(to) if cl.weapon_set.include?(from)
end
filename = "Data/Weapons.rxdata"
filename1 = "Data/Classes.rxdata"
file = File.open(filename, "wb")
file1 = File.open(filename1, "wb")
Marshal.dump(d,file)
Marshal.dump(c,file1)
file.close
file1.close
$data_weapons = load_data(filename)
$data_classes = load_data(filename1)
end