diff --git a/src/core/ArxGame.cpp b/src/core/ArxGame.cpp index 7d1e6da5a7..b430ed85d4 100644 --- a/src/core/ArxGame.cpp +++ b/src/core/ArxGame.cpp @@ -905,10 +905,7 @@ bool ArxGame::addPaks() { static void ReleaseSystemObjects() { - delete hero, hero = nullptr; - if(entities.size() > 0 && entities.player() != nullptr) { - entities.player()->obj = nullptr; // already deleted above (hero) delete entities.player(); arx_assert(entities.size() > 0 && entities.player() == nullptr); } diff --git a/src/game/Equipment.cpp b/src/game/Equipment.cpp index 5c5b760460..13b74bf58b 100644 --- a/src/game/Equipment.cpp +++ b/src/game/Equipment.cpp @@ -221,8 +221,7 @@ void ARX_EQUIPMENT_RecreatePlayerMesh() { arx_assert(entities.player()); Entity * io = entities.player(); - if(io->obj != hero) - delete io->obj; + delete io->obj; io->obj = loadObject("graph/obj3d/interactive/npc/human_base/human_base.teo", false).release(); @@ -250,7 +249,6 @@ void ARX_EQUIPMENT_RecreatePlayerMesh() { ARX_INTERACTIVE_Show_Hide_1st(entities.player(), !EXTERNALVIEW); ARX_INTERACTIVE_HideGore(entities.player(), false); - EERIE_Object_Precompute_Fast_Access(hero); EERIE_Object_Precompute_Fast_Access(entities.player()->obj); ARX_INTERACTIVE_RemoveGoreOnIO(entities.player()); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 98c7d2559f..b43c75afdc 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -147,7 +147,6 @@ extern long COLLIDED_CLIMB_POLY; static const float ARX_PLAYER_SKILL_STEALTH_MAX = 100.f; ARXCHARACTER player; -EERIE_3DOBJ * hero = nullptr; float currentdistance = 0.f; float CURRENT_PLAYER_COLOR = 0; AnimationDuration PLAYER_ROTATION = 0; @@ -1083,9 +1082,6 @@ void ARX_PLAYER_Restore_Skin() { */ void ARX_PLAYER_LoadHeroAnimsAndMesh() { - hero = loadObject("graph/obj3d/interactive/npc/human_base/human_base.teo", false).release(); - PLAYER_SKIN_TC = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero_head"); - herowaitbook = EERIE_ANIMMANAGER_Load("graph/obj3d/anims/npc/human_wait_book.tea"); EERIE_ANIMMANAGER_Load("graph/obj3d/anims/npc/human_normal_wait.tea"); herowait_2h = EERIE_ANIMMANAGER_Load("graph/obj3d/anims/npc/human_wait_book_2handed.tea"); @@ -1095,7 +1091,9 @@ void ARX_PLAYER_LoadHeroAnimsAndMesh() { arx_assert(entities.player() == io); arx_assert(io->idString() == "player"); - io->obj = hero; + arx_assert(!io->obj); + io->obj = loadObject("graph/obj3d/interactive/npc/human_base/human_base.teo", false).release(); + PLAYER_SKIN_TC = TextureContainer::Load("graph/obj3d/textures/npc_human_base_hero_head"); player.skin = 0; ARX_PLAYER_Restore_Skin(); diff --git a/src/game/Player.h b/src/game/Player.h index 573809a7fa..1ab1920783 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -408,7 +408,6 @@ struct ARXCHARACTER { extern float CURRENT_PLAYER_COLOR; extern ARXCHARACTER player; -extern EERIE_3DOBJ * hero; extern ANIM_HANDLE * herowaitbook; extern ANIM_HANDLE * herowait_2h; extern std::vector g_playerQuestLogEntries;