From 1883b7e8103e2f805de161cbf363e2eb7f744b46 Mon Sep 17 00:00:00 2001 From: Cuicui Date: Fri, 10 Jul 2020 20:39:20 -0300 Subject: [PATCH 1/2] Posible arreglo al changeHeading del NPC Antes el NPC al colisionar con un usuario que quiere atacar no te actualizaba el heading --- Codigo/MODULO_NPCs.bas | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Codigo/MODULO_NPCs.bas b/Codigo/MODULO_NPCs.bas index d789c8001..8f3993ff7 100644 --- a/Codigo/MODULO_NPCs.bas +++ b/Codigo/MODULO_NPCs.bas @@ -819,13 +819,24 @@ 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 .NPCtype <> eNPCType.Pretoriano Then + 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 + End If ' es una posicion legal If LegalPosNPC(nPos.Map, nPos.X, nPos.Y, .flags.AguaValida = 1, .MaestroUser <> 0) Then From 694a902820df0a4d583906f1127381b4677857ff Mon Sep 17 00:00:00 2001 From: Cuicui Date: Fri, 10 Jul 2020 20:53:05 -0300 Subject: [PATCH 2/2] =?UTF-8?q?saco=20la=20comprobaci=C3=B3n=20del=20eNPCT?= =?UTF-8?q?ype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Codigo/MODULO_NPCs.bas | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Codigo/MODULO_NPCs.bas b/Codigo/MODULO_NPCs.bas index 8f3993ff7..c62db3500 100644 --- a/Codigo/MODULO_NPCs.bas +++ b/Codigo/MODULO_NPCs.bas @@ -831,11 +831,9 @@ Public Function MoveNPCChar(ByVal NpcIndex As Integer, ByVal nHeading As Byte) A oldPos = .Pos oldHeading = .Char.heading Call HeadtoPos(nHeading, nPos) - If .NPCtype <> eNPCType.Pretoriano Then - 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 + 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