rbxb / place

a clone of r/place
GNU General Public License v3.0
84 stars 61 forks source link

Probable misbehavior for invalid position #1

Closed BenWiederhake closed 3 years ago

BenWiederhake commented 3 years ago

https://github.com/rbxb/place/blob/50771a1c0f070d1a01c9c49043585897d3219aa8/server.go#L186

I believe the correct approach would be:

if 0 > x || x >= width || 0 > y || y >= height {
    return false
}
rbxb commented 3 years ago

Yes! Looks like a relic from me moving the successful path from inside the if statement to outside.