mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Fix bitwise negation in CollisionMatrix#clear()
Adds the missing bitwise AND to the clear() method in CollisionMatrix, so any flags besides the one given are retained.
This commit is contained in:
@@ -104,6 +104,18 @@ public final class CollisionMatrix {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Completely blocks the tile at the specified coordinate pair, while optionally allowing projectiles
|
||||
* to pass through.
|
||||
*
|
||||
* @param x The x coordinate.
|
||||
* @param y The y coordinate.
|
||||
* @param impenetrable If projectiles should be permitted to traverse this tile.
|
||||
*/
|
||||
public void block(int x, int y, boolean impenetrable) {
|
||||
set(x, y, impenetrable ? ALL_BLOCKED : ALL_MOBS_BLOCKED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Completely blocks the tile at the specified coordinate pair.
|
||||
*
|
||||
@@ -123,7 +135,7 @@ public final class CollisionMatrix {
|
||||
* @param flag The CollisionFlag.
|
||||
*/
|
||||
public void clear(int x, int y, CollisionFlag flag) {
|
||||
set(x, y, (byte) ~flag.asByte());
|
||||
set(x, y, (byte) (matrix[indexOf(x, y)] & ~flag.asByte()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user