Add guard check to set.key opcode.

svn-id: r41260
This commit is contained in:
Eugene Sandulenko 2009-06-06 17:48:30 +00:00
parent ea3373708c
commit 0057d9b9b2

View File

@ -1406,6 +1406,11 @@ cmd(set_cursor_char) {
cmd(set_key) {
int key;
if (game.lastController >= MAX_CONTROLLERS) {
warning("Number of set.keys exceeded %d", MAX_CONTROLLERS);
return;
}
debugC(4, kDebugLevelScripts, "%d %d %d", p0, p1, p2);
key = 256 * p1 + p0;