From 77f22d0571ddca7bbfd1d1f621d61785d375c889 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 20 Mar 2017 11:54:20 +0100 Subject: [PATCH] Building default player after PersonTypes are loaded to avoid segfault --- Source/GameInitDispose.cpp | 2 ++ Source/Objects/Person.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index e84f10e..a1e9603 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -602,6 +602,8 @@ void Game::InitGame() Animation::loadAll(); PersonType::Load(); + + Person::players.emplace_back(new Person()); } void Game::LoadScreenTexture() diff --git a/Source/Objects/Person.cpp b/Source/Objects/Person.cpp index e9ccbbf..47e2e52 100644 --- a/Source/Objects/Person.cpp +++ b/Source/Objects/Person.cpp @@ -72,7 +72,7 @@ extern float envsoundlife[30]; extern XYZ windvector; -std::vector> Person::players(1, std::shared_ptr(new Person())); +std::vector> Person::players; Person::Person() : whichpatchx(0) -- 2.39.5