Skip to content

more general fix for GameNetworkException being unexpectedly thrown & stopping scripts

Logg requested to merge Loggy/openrsc:fix-packet-send-error-halt-script into develop

This reverts !3926 (merged) and more generalizes it so that ActionSender.[sendPacket]() does not unexpectedly stop scripts, causing bugs such as (probably) the bug where an NPC can be stuck in combat.

I also found why the function threw GameNetworkException and rewrote the part that relied on catching that error. As far as I can tell, there is no other place where GameNetworkException is caught. I also briefly skimmed all usages of "catch (Exception ...)" and it doesn't seem to be applicable to this previously thrown error.

In most cases, we should not care if a packet is actually correctly generated & sent to a player or not when deciding whether to continue game logic in a script. It is expected that it will most often cause a bug if a script is stopped unexpectedly mid-execution. We will monitor for any unintended behaviour changes, however.

Edited by Logg

Merge request reports