fix(client): drain flying objects before effect shutdown

This commit is contained in:
shen
2026-10-16 23:12:13 -07:00
parent 569afb1378
commit b9f5d737cb
4 changed files with 22 additions and 1 deletions
+10
View File
@@ -26,6 +26,8 @@
#include "EterLib/StateManager.h"
#include "EterLib/Util.h"
#include "EterPythonLib/PythonGraphic.h"
#include "GameLib/FlyingObjectManager.h"
#include "GameLib/FlyingInstance.h"
#include <dinput.h> // DIK_ESCAPE
#include <cmath>
@@ -425,9 +427,17 @@ int main(int argc, char** argv)
frames(1);
CHECK(!PythonBoot::IsAppLooping());
CHECK(py("assert _stream.curPhaseWindow == 0 and _stream.popupWindow == 0"));
// A missile may still be travelling when the window closes. Its attachments
// must be destroyed before the effect singleton, as in CPythonApplication::Destroy.
const char* flying = "d:/ymir work/effect/etc/gathering/ga_piece_yellow_small2.msf";
DWORD flying_crc = 0;
CFlyingManager::Instance().RegisterFlyingData(flying, flying_crc);
CHECK(CFlyingManager::Instance().CreateFlyingInstanceFlyTarget(flying_crc,
D3DXVECTOR3(0, 0, 0), CFlyTarget(D3DXVECTOR3(1000, 0, 0)), false));
PythonBoot::Stop();
CHECK(!PythonBoot::IsRunning());
PythonBoot::Stop(); // teardown remains idempotent
if (g_failures)
std::fprintf(stderr, "%d check(s) failed\n", g_failures);