From: Côme Chilliet Date: Mon, 20 Mar 2017 10:54:20 +0000 (+0100) Subject: Building default player after PersonTypes are loaded to avoid segfault X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=77f22d0571ddca7bbfd1d1f621d61785d375c889;p=lugaru.git Building default player after PersonTypes are loaded to avoid segfault --- 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)