| 295 | } |
| 296 | |
| 297 | Point GetItemPosition(Point position) |
| 298 | { |
| 299 | if (CanPut(position)) |
| 300 | return position; |
| 301 | |
| 302 | for (int k = 1; k < 50; k++) { |
| 303 | for (int j = -k; j <= k; j++) { |
| 304 | int yy = position.y + j; |
| 305 | for (int l = -k; l <= k; l++) { |
| 306 | int xx = position.x + l; |
| 307 | if (CanPut({ xx, yy })) |
| 308 | return { xx, yy }; |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | return position; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * @brief Throttles that a player command is only sent once per game tick. |
no test coverage detected