Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noticed this in gamemap.js in the floodFill function #3

Open
F0x1 opened this issue Mar 27, 2023 · 0 comments
Open

Noticed this in gamemap.js in the floodFill function #3

F0x1 opened this issue Mar 27, 2023 · 0 comments

Comments

@F0x1
Copy link

F0x1 commented Mar 27, 2023

not necessarily a bug but for computation sake this.getMinMaxPlayerCoords should only be called only once instead of 4 times so code at bottom is the simplified version of this
var tempMinX = this.getMinMaxPlayerCoords(player.id).minX; tempMinX -= 1; var tempMaxX = this.getMinMaxPlayerCoords(player.id).maxX; tempMaxX += 1; var tempMinY = this.getMinMaxPlayerCoords(player.id).minY; tempMinY -= 1; var tempMaxY = this.getMinMaxPlayerCoords(player.id).maxY; tempMaxY += 1;

var playerCoords = this.getMinMaxPlayerCoords(player.id); var tempMinX = playerCoords.minX - 1; var tempMaxX = playerCoords.maxX + 1; var tempMinY = playerCoords.minY - 1; var tempMaxY = playerCoords.maxY + 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant