mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-20 06:33:49 +01:00
Fixed Stanek fragment collision detection
Relaxed some overzealous short-circuiting to ensure fragments on the Stanek's Gift board properly check for collisions.
This commit is contained in:
parent
89f73d88d1
commit
749b93608b
@ -40,8 +40,9 @@ export class ActiveFragment {
|
||||
// These 2 variables converts 'this' local coordinates to world to other local.
|
||||
const dx: number = other.x - this.x;
|
||||
const dy: number = other.y - this.y;
|
||||
for (let j = 0; j < thisFragment.shape.length; j++) {
|
||||
for (let i = 0; i < thisFragment.shape[j].length; i++) {
|
||||
const fragSize = Math.max(thisFragment.shape.length, thisFragment.shape[0].length);
|
||||
for (let j = 0; j < fragSize; j++) {
|
||||
for (let i = 0; i < fragSize; i++) {
|
||||
if (thisFragment.fullAt(i, j, this.rotation) && otherFragment.fullAt(i - dx, j - dy, other.rotation))
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user