skyrim-multiplayer / skymp

Multiplayer Mod & TypeScript SDK for Skyrim Special Edition
Other
220 stars 74 forks source link

[Bug]: CTD occurs when reloading a save if using a script that has registered the effectStart or effectFinish event. #1540

Open oto-git opened 1 year ago

oto-git commented 1 year ago

Severity

Critical. A critical defect that causes some key functionality to fail.

Priority

High. Anything that impacts the typical user flow or blocks app usage.

Description

After registering an effectStart or effectFinish event to cause a random NPC to appear, reloading a save of the situation before the random NPC appeared caused the game to CTD upon load completion. If the effectStart and effectFinish events were unregistered using the unsubscribe function before loading, such as in the preLoadGame event, a CTD did not occur after loading was complete. (If the events were not unregistered, a CTD occurred.)

NetScriptFramework Crash Log: https://drive.google.com/file/d/1SNiB4DxN8s8YFLyq8s7UUt9TmmEcywZz/view?usp=sharing

https://github.com/skyrim-multiplayer/skymp/issues/1305 Not sure if this is related, but the phenomenon is similar to the bug report above.

OS

Windows

OS version

10

Skyrim version

1.5.97.0.8

SKSE version

2.0.20

client commit''s hash

None

server commit''s hash

None

Videocard model

Radeon RX 590

Steps to reproduce

on('effectStart', (event) => {
});

on('effectFinish', (event) => {
});

Execute the above script process and perform the following steps with effectStart or effectFinish event registered.

  1. Save somewhere, whether internal or external.
  2. In the console, "player.placeatme 0001bcd8 5" and a random NPC will appear.
  3. Reload the save from step 1.

Expected result

No crashes after loading the save.

Actual result

The game crashes as soon as the loading completes.

oto-git commented 1 year ago

https://github.com/skyrim-multiplayer/skymp/issues/1544 We have confirmed a similar phenomenon for the combatState event and have filed a separate bug report.