Skip to content

Commit 432e922

Browse files
committed
fix off by one int for drawing strings
1 parent 22aefa8 commit 432e922

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/JavaBWAPIBackend/Client.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ public class Event {
441441
public int addString(String s) {
442442
if(s.length() >= 1024)
443443
throw new StringIndexOutOfBoundsException();
444-
int at = sharedMemory.getInt(StringOffset + 256000);
444+
int at = sharedMemory.getInt(StringOffset + 256004);
445445
sharedMemory.position(StringOffset + 256008 + at * 1024);
446446
sharedMemory.put(s.getBytes(StandardCharsets.ISO_8859_1), 0, s.length());
447447
sharedMemory.position(0);
448-
sharedMemory.putInt(StringOffset + 256000, at + 1);
448+
sharedMemory.putInt(StringOffset + 256004, at + 1);
449449
return at;
450450
}
451451

src/main/java/bwapi/point/Point.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import bwapi.Game;
44

55
abstract class Point {
6-
static final int TILE_WALK_FACTOR = 4; // 32 / 4
6+
static final int TILE_WALK_FACTOR = 4; // 32 / 8
77

88
public final int x;
99
public final int y;

0 commit comments

Comments
 (0)