Fixes Case Insensitive Broadcast Bug

Broadcasts are case sensitive #433
This commit is contained in:
griffpatch 2017-02-08 10:05:48 +00:00
parent aecc3bf893
commit 276ae82769

View file

@ -439,6 +439,11 @@ Runtime.prototype.startHats = function (requestedHatOpcode,
}
var instance = this;
var newThreads = [];
for (var opts in optMatchFields) {
optMatchFields[opts] = optMatchFields[opts].toUpperCase();
}
// Consider all scripts, looking for hats with opcode `requestedHatOpcode`.
this.allScriptsDo(function (topBlockId, target) {
var potentialHatOpcode = target.blocks.getBlock(topBlockId).opcode;
@ -466,7 +471,7 @@ Runtime.prototype.startHats = function (requestedHatOpcode,
if (optMatchFields) {
for (var matchField in optMatchFields) {
if (hatFields[matchField].value !==
if (hatFields[matchField].value.toUpperCase() !==
optMatchFields[matchField]) {
// Field mismatch.
return;