Ensure that entities always recognize their songs properly. miscellaneous-fixes
authorachurch
Sun, 30 Jan 2011 02:00:18 +0900
branchmiscellaneous-fixes
changeset 652 8cc6d08d2392
parent 639 3e9ea3275214
child 653 54626bb54d30
child 655 89e8c6a9ffb9
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.
game_scripts/scripts/entities/deepwhale.lua
game_scripts/scripts/entities/licage.lua
--- 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