Browse Source

Load objcurs when creating starting items

pull/6983/head
staphen 2 years ago committed by Anders Jenbo
parent
commit
bc4f43490f
  1. 2
      Source/items.cpp
  2. 2
      test/player_test.cpp
  3. 1
      test/writehero_test.cpp

2
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];

2
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);

1
test/writehero_test.cpp

@ -384,7 +384,6 @@ TEST(Writehero, pfile_write_hero)
MyPlayerId = 0;
MyPlayer = &Players[MyPlayerId];
InitCursor();
LoadSpellData();
LoadPlayerDataFiles();
LoadItemData();

Loading…
Cancel
Save