Ensure that entities always recognize their songs properly.
This patch fixes a bug in the DeepWhale and LiCage entities in which the
song to activate the entity would not be recognized if immediately
preceded by singing part (but not all) of that song. For example, given
the song A-B-C-D, the sequence of notes A-B-A-B-C-D would trigger this
bug: the second A is tested against the expected note C and fails, but
is not then checked against the first note of the song.
--- a/game_scripts/scripts/entities/deepwhale.lua Fri Jan 07 02:36:27 2011 +0900
+++ b/game_scripts/scripts/entities/deepwhale.lua Sun Jan 30 02:00:18 2011 +0900
@@ -129,6 +129,8 @@
debugLog(string.format("curNote: %d", curNote))
if notes[curNote] == note then
curNote = curNote + 1
+ elseif notes[1] == note then
+ curNote = 2
else
curNote = 1
end
--- a/game_scripts/scripts/entities/licage.lua Fri Jan 07 02:36:27 2011 +0900
+++ b/game_scripts/scripts/entities/licage.lua Sun Jan 30 02:00:18 2011 +0900
@@ -262,6 +262,8 @@
--debugLog(string.format("curNote: %d", curNote))
if notes[curNote] == note then
curNote = curNote + 1
+ elseif notes[1] == note then
+ curNote = 2
else
curNote = 1
end