Minor refactoring to kill various Rubocop warnings

This commit is contained in:
Maruno17
2021-12-17 20:29:47 +00:00
parent b5ee1b211d
commit 5dc64f1709
46 changed files with 145 additions and 151 deletions

View File

@@ -79,7 +79,7 @@ def oggfiletime(file)
end
ret = 0.0
for i in 0...pcmlengths.length
ret += pcmlengths[i].to_f / rates[i].to_f
ret += pcmlengths[i].to_f / rates[i]
end
return ret * 256.0
end
@@ -136,7 +136,7 @@ def getPlayTime2(filename)
end
file.pos = 0
# Find the length of an MP3 file
while true
loop do
rstr = ""
ateof = false
while !file.eof?

View File

@@ -29,8 +29,8 @@ def pbResolveAudioFile(str,volume=nil,pitch=nil)
end
if str.is_a?(RPG::AudioFile)
if volume || pitch
return RPG::AudioFile.new(str.name,volume || str.volume || 100 ,
pitch || str.pitch || 100)
return RPG::AudioFile.new(str.name, volume || str.volume || 100,
pitch || str.pitch || 100)
else
return str
end