Fix walkthrough objects overriding collision...

...of solid objects when it comes to the movement of the player.
This commit is contained in:
JappaWakka 2024-10-10 09:58:35 +02:00
parent 15dd897e9a
commit 66de1ce8c9
1 changed files with 12 additions and 4 deletions

View File

@ -868,17 +868,25 @@ Public Class OverworldCamera
If Entity.EntityID.ToLower = "npc" Then
If Entity.ViewBox.Contains(PlayerBoundingBox) = ContainmentType.Intersects Then
If Entity.Collision = True Then
cannotWalk = Entity.WalkAgainstFunction()
If Entity.WalkAgainstFunction() = True Then
cannotWalk = True
End If
Else
cannotWalk = Entity.WalkIntoFunction()
If Entity.WalkIntoFunction() = True Then
cannotWalk = True
End If
End If
End If
Else
If Entity.boundingBox.Contains(Position2D) = ContainmentType.Contains Then
If Entity.Collision = True Then
cannotWalk = Entity.WalkAgainstFunction()
If Entity.WalkAgainstFunction() = True Then
cannotWalk = True
End If
Else
cannotWalk = Entity.WalkIntoFunction()
If Entity.WalkIntoFunction() = True Then
cannotWalk = True
End If
End If
ElseIf Entity.boundingBox.Contains(New Vector3(Position2D.X, Position2D.Y - 1, Position2D.Z)) = ContainmentType.Contains Then
Entity.WalkOntoFunction()