From bc4f43490f36cbc7478524bf8cb37e0afbd8c833 Mon Sep 17 00:00:00 2001 From: staphen Date: Thu, 22 Feb 2024 20:49:52 -0500 Subject: [PATCH] Load objcurs when creating starting items --- Source/items.cpp | 2 ++ test/player_test.cpp | 2 -- test/writehero_test.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index f136bff40df..dbb85ddbbb3 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3023,11 +3023,13 @@ void CreatePlrItems(Player &player) } } + InitCursor(); for (auto &itemChoice : loadout.items) { _item_indexes itemData = gbIsHellfire && itemChoice.hellfire != _item_indexes::IDI_NONE ? itemChoice.hellfire : itemChoice.diablo; if (itemData != _item_indexes::IDI_NONE) CreateStartingItem(player, itemData); } + FreeCursor(); if (loadout.gold > 0) { Item &goldItem = player.InvList[player._pNumInv]; diff --git a/test/player_test.cpp b/test/player_test.cpp index 5d4d7a43daa..40dec523fac 100644 --- a/test/player_test.cpp +++ b/test/player_test.cpp @@ -188,8 +188,6 @@ TEST(Player, CreatePlayer) // Please provide them so that the tests can run successfully ASSERT_TRUE(HaveSpawn() || HaveDiabdat()); - InitCursor(); - LoadPlayerDataFiles(); LoadItemData(); Players.resize(1); diff --git a/test/writehero_test.cpp b/test/writehero_test.cpp index 30d38396062..adef0be6db6 100644 --- a/test/writehero_test.cpp +++ b/test/writehero_test.cpp @@ -384,7 +384,6 @@ TEST(Writehero, pfile_write_hero) MyPlayerId = 0; MyPlayer = &Players[MyPlayerId]; - InitCursor(); LoadSpellData(); LoadPlayerDataFiles(); LoadItemData();