From 941d76fce07e4d154cbeaf84d588091f5c53f778 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 2 Sep 2016 04:31:35 +0300 Subject: [PATCH] Fix setting of default classes and initialize classes safely on server --- apps/openmw-mp/Player.cpp | 1 + apps/openmw/mwmp/LocalPlayer.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index 0cc5dab0f..87125435c 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -35,6 +35,7 @@ void Players::NewPlayer(RakNet::RakNetGUID id) players[id]->Npc()->blank(); players[id]->NpcStats()->blank(); players[id]->CreatureStats()->blank(); + players[id]->klass.blank(); for (int i = 0; i < mwmp::Networking::Get().MaxConnections(); i++) { diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 7ed494a32..990842097 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -594,7 +594,7 @@ void LocalPlayer::SetClass() } else { - MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass); + MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass.mId); const ESM::Class *_klass = MWBase::Environment::get().getWorld()->getStore().get().find(klass.mId); if (_klass) MWBase::Environment::get().getWindowManager()->setPlayerClass(klass);