Skip to content

Logic: GetBlock SetBlock & unitControl Build should use the same tile logic #12223

Description

@Jackson11500

Platforms

Windows

Build

158.1

Issue

if the coordinate is not an integer type(eg. sensor the @x of unit), at some situation the getBlock, setBlock and unitControl-build would respond differently. Although you could add op round x x b to resolve this problem, but I believe that it would be better to use the same coordinate system.

To be more specific, for the setBlock logic

Tile tile = world.tile(x.numi(), y.numi());

but for the getBlock logic

world.tile(Mathf.round(x.numf()), Mathf.round(y.numf()))

and unitControl build is more complicated and is differ from the others.

Steps to reproduce

The following is an example of how this problem works

set x 62.6
set y 334.6
setblock block @router x y @derelict 0
getblock block result x y

Image

Mods used

No response

Save file

No response

(Crash) logs

No response

Submission

  • I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.
  • I have searched the closed and open issues to make sure that this problem has not already been reported.
  • I am not using Foo's Client, and have made sure the bug is not caused by mods I have installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions