Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Posible arreglo al changeHeading del NPC #735

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions Codigo/MODULO_NPCs.bas
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,22 @@ Public Function MoveNPCChar(ByVal NpcIndex As Integer, ByVal nHeading As Byte) A

On Error GoTo errh

Dim nPos As WorldPos

Dim Userindex As Integer

Dim nPos As WorldPos
Dim Userindex As Integer

With Npclist(NpcIndex)
nPos = .Pos

' @@ Fix?
Dim oldPos As WorldPos
Dim oldHeading As eHeading
oldPos = .Pos
oldHeading = .Char.heading
Call HeadtoPos(nHeading, nPos)
If oldHeading <> nHeading Or (oldPos.X <> nPos.X Or oldPos.Y <> nPos.Y) Then
.Char.heading = nHeading
Call SendData(SendTarget.ToNPCArea, NpcIndex, PrepareMessageHeadingChange(nHeading, .Char.CharIndex))
End If

' es una posicion legal
If LegalPosNPC(nPos.Map, nPos.X, nPos.Y, .flags.AguaValida = 1, .MaestroUser <> 0) Then
Expand Down