LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
294 stars 592 forks source link

Value Missing in Action Packet #1877

Closed Dev-Roland closed 2 years ago

Dev-Roland commented 2 years ago

Branch affected by issue

base

Steps to reproduce

Steps to reproduce: (Omicron server)

METHOD 1

  1. Load game in Windower with the Battlemod addon loaded
  2. Summon trusts (I used Halver/Ayame/Valaineral/Excenmille, though this has happened when I had no trusts out)
  3. Fight enemies and this error should trigger roughly once every 3-5 minutes, often within 1~3 seconds of engaging.

METHOD 2

  1. Load game in Windower with the Battlemod addon loaded
  2. Accumulate 1000 TP
  3. Engage an enemy from 6~25 yalms
  4. Attempt a WS from out of range
  5. This triggers two chat messages. 1) WS attempt. 2) Mob out of range. Either one could be the trigger
  6. That should trigger the error in the console

NOTE: The error printed in the console is "_Lua runtime error: battlemod/parse_actionpacket.lua:709: attempt to index field '?' (a nil value)" Line 709: _local msgID = act.targets[1].actions[1].message

Expected behavior

Apparently a portion of the action packet is expected to be defined that is undefined in LSB.

zach2good commented 2 years ago

Interesting! Thanks for the report, I'll take a look at this when I'm back from holiday if someone else doesn't get to it first

Dev-Roland commented 2 years ago

I updated the issue with a second method. I've isolated out a single action that consistently triggers the error. I'm not sure if it was the 2nd method that triggered the error all along or if there is more than one trigger. I have a feeling it was the former.

WinterSolstice8 commented 2 years ago

I was looking at the code earlier, and I did speculate that's possible. Trusts can/do attempt WS when out of range, particularly Valaineral.

There's a code block to generate an action packet and then populates the targets based on if they are in range or not. I am guessing this means that we need to populate an action with an "out of range" message, cancel the action, or otherwise. Thanks for the repro steps!

zach2good commented 2 years ago

Related issue: https://github.com/LandSandBoat/server/issues/2019

WinterSolstice8 commented 2 years ago

I'll be working on this