mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-02-20 11:58:28 +08:00
Grid collision check crash
This commit is contained in:
parent
ad9acf4fe1
commit
f6eabf5fc3
@ -313,12 +313,12 @@ namespace Strawberry
|
||||
|
||||
public bool Check(Grid grid)
|
||||
{
|
||||
return grid.Check(SceneHitbox);
|
||||
return grid != null && grid.Check(SceneHitbox);
|
||||
}
|
||||
|
||||
public bool Check(Grid grid, Point offset)
|
||||
{
|
||||
return grid.Check(SceneHitbox + offset);
|
||||
return grid != null && grid.Check(SceneHitbox + offset);
|
||||
}
|
||||
|
||||
public bool Check(Entity other)
|
||||
|
@ -89,7 +89,7 @@ namespace Strawberry
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Check(Scene.SolidGrid, .(sign, 0)))
|
||||
if (Check(Scene, .(sign, 0)))
|
||||
{
|
||||
let c = Collision(
|
||||
Point.Right * sign,
|
||||
@ -134,7 +134,7 @@ namespace Strawberry
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Check(Scene.SolidGrid, .(0, sign)))
|
||||
if (Check(Scene, .(0, sign)))
|
||||
{
|
||||
let c = Collision(
|
||||
Point.Right * sign,
|
||||
|
Loading…
Reference in New Issue
Block a user