Skip to content

Commit

Permalink
Fixing mklang file problems on windows and adding some errors to catc…
Browse files Browse the repository at this point in the history
…h in SaveLoad
  • Loading branch information
mshirt committed May 7, 2017
1 parent 8105180 commit 4c61892
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -16,3 +16,5 @@ Makefile*

object_script.*
rpgscript.bat
oneshot_JA_2_merge.pot
rpgscript - mklang.bat
3 changes: 2 additions & 1 deletion mklang.rb
@@ -1,4 +1,5 @@
#!/usr/bin/ruby
#encoding: utf-8

require 'get_pomo'
require 'zlib'
Expand All @@ -11,7 +12,7 @@
src_file = ARGV[0]
dst_file = ARGV[1]

po = GetPomo::PoFile.parse(File.read(src_file))
po = GetPomo::PoFile.parse(File.read(src_file, :encoding => 'utf-8'))

File.open(dst_file, 'wb') do |file|
file.write(Marshal.dump(po.map do |t|
Expand Down
8 changes: 4 additions & 4 deletions scripts/SaveLoad.rb
Expand Up @@ -163,7 +163,7 @@ def load_perma_flags

begin
read_perma_flags(PERMA_FLAGS_NAME)
rescue TypeError => e
rescue TypeError, ArgumentError => e
puts "oops: #{e.message}"
EdText.err("p-settings.dat corrupt. Attempting to load backup.")
for i in 1..6
Expand All @@ -177,7 +177,7 @@ def load_perma_flags
begin
read_perma_flags(Oneshot::SAVE_PATH + "\\save_backups\\p-settings" + (i).to_s + ".bk")
break
rescue TypeError => e2
rescue TypeError, ArgumentError => e2
puts "oops: #{e2.message}"
EdText.err("p-settings" + (i).to_s + ".bk corrupt. Attempting to load backup.")
end
Expand Down Expand Up @@ -210,7 +210,7 @@ def real_load
#load save data
begin
load(SAVE_FILE_NAME)
rescue TypeError => e
rescue TypeError, ArgumentError => e
puts "oops: #{e.message}"
EdText.err("save.dat corrupt. Attempting to load backup.")
for i in 1..6
Expand All @@ -224,7 +224,7 @@ def real_load
begin
load(Oneshot::SAVE_PATH + "\\save_backups\\save" + (i).to_s + ".bk")
break
rescue TypeError => e2
rescue TypeError, ArgumentError => e2
puts "oops: #{e2.message}"
EdText.err("save" + (i).to_s + ".bk corrupt. Attempting to load backup.")
end
Expand Down

0 comments on commit 4c61892

Please sign in to comment.