From a2f6d99dfdeec436633d50b8f34dc94e3a225539 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 29 Apr 2017 18:20:01 +0300 Subject: [PATCH] [Server] Use new CreatureStats in ActorFunctions to fix invalid pointer --- apps/openmw-mp/Script/Functions/Actors.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 4e26f609a..0cad5f046 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -27,6 +27,8 @@ void ActorFunctions::InitScriptActorList(unsigned short pid) noexcept scriptActorList.cell.blank(); scriptActorList.baseActors.clear(); scriptActorList.guid = player->guid; + + tempActor.creatureStats = new ESM::CreatureStats(); } unsigned int ActorFunctions::GetActorListSize() noexcept @@ -199,6 +201,7 @@ void ActorFunctions::AddActor() noexcept scriptActorList.baseActors.push_back(tempActor); tempActor = emptyActor; + tempActor.creatureStats = new ESM::CreatureStats(); } void ActorFunctions::SendActorList() noexcept