]> git.jsancho.org Git - lugaru.git/commitdiff
Building default player after PersonTypes are loaded to avoid segfault
authorCôme Chilliet <come@chilliet.eu>
Mon, 20 Mar 2017 10:54:20 +0000 (11:54 +0100)
committerCôme Chilliet <come@chilliet.eu>
Mon, 20 Mar 2017 10:54:20 +0000 (11:54 +0100)
Source/GameInitDispose.cpp
Source/Objects/Person.cpp

index e84f10ebb61f29d28eb7cc33c8570092de12d9b3..a1e96031da4ccf4d13245e7a971ca721384b8097 100644 (file)
@@ -602,6 +602,8 @@ void Game::InitGame()
     Animation::loadAll();
 
     PersonType::Load();
+
+    Person::players.emplace_back(new Person());
 }
 
 void Game::LoadScreenTexture()
index e9ccbbf9b6ea753b11aef0a8a54a572991e6919e..47e2e520c0987665e3c9381d38e5559399c3983d 100644 (file)
@@ -72,7 +72,7 @@ extern float envsoundlife[30];
 
 extern XYZ windvector;
 
-std::vector<std::shared_ptr<Person>> Person::players(1, std::shared_ptr<Person>(new Person()));
+std::vector<std::shared_ptr<Person>> Person::players;
 
 Person::Person()
     : whichpatchx(0)