Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.55k stars 2.95k forks source link

Getblock type does not return comparable type with stone-walls #4436

Closed Sp3rw3r closed 3 years ago

Sp3rw3r commented 3 years ago

Platform: Android/iOS/Mac/Windows/Linux

Build: 123

Issue: scanning a stone-wall with getblock returns @stone-wall as type. However this cannot be compared against the string "@stone-wall" In program without the quotes.

edit string is a bad way to phrase this. See 2nd comment

Steps to reproduce: Nestor came up with it in the Mindustry discord. We both tested some logic that scanned a wall and compared it and printed the result.

Link(s) to mod(s) used: The mod repositories or zip files that are related to the issue, if applicable.

Save file: The (zipped) save file you were playing on when the bug happened. THIS IS REQUIRED FOR ANY ISSUE HAPPENING IN-GAME OR IN MULTIPLAYER, REGARDLESS OF WHETHER YOU THINK IT HAPPENS EVERYWHERE. DO NOT DELETE OR OMIT THIS LINE UNLESS YOU ARE SURE THAT THE ISSUE DOES NOT HAPPEN IN-GAME.

If you remove the line above without reading it properly and understanding what it means, I will reap your soul. Even if you're playing on someone's server, you can still save the game to a slot.

(Crash) logs: Either crash reports from the crash folder, or the file you get when you go into Settings -> Game Data -> Export Crash logs. REQUIRED if you are reporting a crash.


Place an X (no spaces) between the brackets to confirm that you have read the line below.

deltanedas commented 3 years ago

blocks can never be compared with strings, only strings can.

Sp3rw3r commented 3 years ago

I did not explain it right. anyway comparing type == @stone-wall fails when print type returns stone-wall

Nester23 commented 3 years ago

Here's my schematic to reproduce the issue. Getblock type bug schematic.txt

Anuken commented 3 years ago

Any solid environmental block returns stone-wall as a block type. @solid is an alias for this block.