survivors: fixing code for mose move

This commit is contained in:
Sheldan
2025-09-08 23:02:35 +02:00
parent a8be84ebd3
commit 28ef7b9c6f

View File

@@ -88,7 +88,7 @@ export class Controls implements DrawContainer, MouseInterActingContainer {
mouseMove(pos: Vector) {
if(this.isPressed()) {
let diff = Vector.createVector(pos, this.centerPosition!);
if(!isNaN(diff.x) && !isNaN(diff.y)) {
if(isNaN(diff.x) || isNaN(diff.y)) {
return;
}
diff = diff.normalize();