Fix block order bug.
This commit is contained in:
parent
259ec3455b
commit
9aa65c5702
|
@ -136,7 +136,7 @@ namespace de4dot.blocks {
|
||||||
void addToNewList(BaseBlock bb) {
|
void addToNewList(BaseBlock bb) {
|
||||||
if (inNewList.ContainsKey(bb) || !scopeBlock.isOurBaseBlock(bb))
|
if (inNewList.ContainsKey(bb) || !scopeBlock.isOurBaseBlock(bb))
|
||||||
return;
|
return;
|
||||||
inNewList[bb] = true;
|
inNewList[bb] = false;
|
||||||
|
|
||||||
var blockInfo = blockInfos[bb];
|
var blockInfo = blockInfos[bb];
|
||||||
var block = bb as Block;
|
var block = bb as Block;
|
||||||
|
@ -145,19 +145,22 @@ namespace de4dot.blocks {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach (var source in block.Sources) {
|
foreach (var source in block.Sources) {
|
||||||
if (scopeBlock.isOurBaseBlock(source)) {
|
if (!scopeBlock.isOurBaseBlock(source))
|
||||||
addToNewList(source); // Make sure it's before this block
|
continue;
|
||||||
|
int oldCount = newList.Count;
|
||||||
|
addToNewList(source); // Make sure it's before this block
|
||||||
|
if (oldCount != newList.Count)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inNewList[bb] = true;
|
||||||
newList.Add(bb);
|
newList.Add(bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isInNewList(IEnumerable<Block> blocks) {
|
bool isInNewList(IEnumerable<Block> blocks) {
|
||||||
foreach (var block in blocks) {
|
foreach (var block in blocks) {
|
||||||
if (inNewList.ContainsKey(block))
|
if (inNewList.ContainsKey(block) && inNewList[block])
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user