westgrass
Terrarian
- Steam or GOG
- Steam
- Single Player/Multiplayer
- Both
- Operating System
- Windows 10
- Terraria Version
- 1.4.2.3
- Controls Used
- Keyboard/Mouse
In Terraria.WorldGen, method ScoreRoom(), there is:
It is used to determine the check range for room evil score. The /16 is used to convert length values in pixels to in blocks.
But, Main.buffScanAreaWidth and Main.buffScanAreaHeight are already in blocks:
Therefore, the check range is much small then intented. The right code here should be(without /16 ):
This can be further proved by the old code. In v1.0.0.0, the code here was:
here Main.screenWidth and Main.screenHeight were in pixels:
Code:
int num4 = roomX1 - Main.buffScanAreaWidth / 2 / 16 - 1 - num3;
int num5 = roomX2 + Main.buffScanAreaWidth / 2 / 16 + 1 + num3;
int num6 = roomY1 - Main.buffScanAreaHeight / 2 / 16 - 1 - num3;
int num7 = roomY2 + Main.buffScanAreaHeight / 2 / 16 + 1 + num3;
But, Main.buffScanAreaWidth and Main.buffScanAreaHeight are already in blocks:
Code:
public static int buffScanAreaWidth = (maxScreenW + 800) / 16 - 1;
public static int buffScanAreaHeight = (maxScreenH + 800) / 16 - 1;
Code:
int num4 = roomX1 - Main.buffScanAreaWidth / 2 - 1 - num3;
int num5 = roomX2 + Main.buffScanAreaWidth / 2 + 1 + num3;
int num6 = roomY1 - Main.buffScanAreaHeight / 2 - 1 - num3;
int num7 = roomY2 + Main.buffScanAreaHeight / 2 + 1 + num3;
This can be further proved by the old code. In v1.0.0.0, the code here was:
Code:
int num5 = roomX1 - Main.screenWidth / 2 / 16 - 1 - 21;
int num6 = roomX2 + Main.screenWidth / 2 / 16 + 1 + 21;
int num7 = roomY1 - Main.screenHeight / 2 / 16 - 1 - 21;
int num8 = roomY2 + Main.screenHeight / 2 / 16 + 1 + 21;
Code:
public static int screenWidth = 800;
public static int screenHeight = 600;
Last edited: