| 691 | } |
| 692 | |
| 693 | void initClass(const int player) |
| 694 | { |
| 695 | Item* item = nullptr; |
| 696 | Item* item2 = nullptr; |
| 697 | auto& hotbar_t = players[player]->hotbar; |
| 698 | auto& hotbar = hotbar_t.slots(); |
| 699 | |
| 700 | bool isLocalPlayer = players[player]->isLocalPlayer(); |
| 701 | |
| 702 | if ( isLocalPlayer ) |
| 703 | { |
| 704 | //TODO: Dedicated gameStartStuff() function. Seriously. |
| 705 | //(same for deathStuff() and/or gameEndStuff(). |
| 706 | players[player]->inventoryUI.selectSlot(0, 0); |
| 707 | players[player]->inventoryUI.selectSpell(0, 0); |
| 708 | players[player]->inventoryUI.selectChestSlot(0, 0); |
| 709 | hotbar_t.clear(); |
| 710 | players[player]->paperDoll.clear(); |
| 711 | } |
| 712 | |
| 713 | bool curseItems = false; |
| 714 | if ( (stats[player]->playerRace == RACE_SUCCUBUS || stats[player]->playerRace == RACE_INCUBUS) |
| 715 | && stats[player]->stat_appearance == 0 ) |
| 716 | { |
| 717 | curseItems = true; |
| 718 | } |
| 719 | |
| 720 | //stats[player]->STR += 1; |
| 721 | |
| 722 | stats[player]->type = HUMAN; |
| 723 | |
| 724 | //spellList = malloc(sizeof(list_t)); |
| 725 | players[player]->magic.spellList.first = nullptr; |
| 726 | players[player]->magic.spellList.last = nullptr; |
| 727 | |
| 728 | |
| 729 | // CLASS LOADOUTS |
| 730 | // barbarian |
| 731 | if ( client_classes[player] == CLASS_BARBARIAN ) |
| 732 | { |
| 733 | initClassStats(client_classes[player], stats[player]); |
| 734 | |
| 735 | if (!isLocalPlayer && multiplayer == CLIENT && intro == false) { |
| 736 | // don't do anything crazy with items on players we don't own |
| 737 | return; |
| 738 | } |
| 739 | |
| 740 | // ring of strength |
| 741 | item = newItem(RING_STRENGTH, WORN, 0, 1, 0, true, nullptr); |
| 742 | if ( isLocalPlayer ) |
| 743 | { |
| 744 | item2 = itemPickup(player, item); |
| 745 | useItem(item2, player); |
| 746 | free(item); |
| 747 | } |
| 748 | else |
| 749 | { |
| 750 | useItem(item, player); |
nothing calls this directly
no test coverage detected