comparison Party.cpp @ 1035:306ec23b37df

004C1EE5 & other stuff
author Nomad
date Wed, 22 May 2013 14:12:51 +0200
parents a704435d3285
children b79139c3b5c8
comparison
equal deleted inserted replaced
1034:aa848c90181f 1035:306ec23b37df
24 24
25 Party *pParty; // idb 25 Party *pParty; // idb
26 26
27 struct ActionQueue *pPartyActionQueue = new ActionQueue; 27 struct ActionQueue *pPartyActionQueue = new ActionQueue;
28 28
29
30
31
32
33 //----- (0044A56A) --------------------------------------------------------
34 void Party::CountHirelings()
35 {
36 field_70A = 0;
37
38 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
39 {
40 auto npc = pNPCStats->pNewNPCData + i;
41 if (npc->Hired() &&
42 (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName)))
43 {
44 if (!pHirelings[1].pName || strcmp(npc->pName, pHirelings[1].pName))
45 ++field_70A;
46 }
47 }
48 }
29 49
30 50
31 // inlined 51 // inlined
32 //----- (mm6c::004858D0) -------------------------------------------------- 52 //----- (mm6c::004858D0) --------------------------------------------------
33 void Party::Zero() 53 void Party::Zero()
784 804
785 for (uint i = 1; i < 20; ++i) 805 for (uint i = 1; i < 20; ++i)
786 pPartyBuffs[i].Reset(); 806 pPartyBuffs[i].Reset();
787 807
788 808
789 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 809 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats
790 uFlags = 0; 810 uFlags = 0;
791 memset(_autonote_bits, 0, 12); 811 memset(_autonote_bits, 0, 12);
792 memset(_quest_bits, 0, 64); 812 memset(_quest_bits, 0, 64);
793 memset(pIsArtifactFound, 0, 29); 813 memset(pIsArtifactFound, 0, 29);
794 _449B7E_toggle_bit(_quest_bits, 1, 1); 814 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1);
795 _449B7E_toggle_bit(_quest_bits, 2, 1); 815 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1);
796 _449B7E_toggle_bit(_quest_bits, 3, 1); 816 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1);
797 _449B7E_toggle_bit(_quest_bits, 4, 1); 817 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1);
798 _449B7E_toggle_bit(_quest_bits, 5, 1); 818 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1);
799 _449B7E_toggle_bit(_quest_bits, 6, 1); 819 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1);
800 820
801 memset(field_3C._shop_ban_times,0,53*sizeof(__int64)); 821 memset(field_3C._shop_ban_times,0,53*sizeof(__int64));
802 822
803 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu); 823 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu);
804 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u); 824 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
826 if ( (signed int)uNumActors > 0 ) 846 if ( (signed int)uNumActors > 0 )
827 { 847 {
828 v0 = pActors;//[0].pMonsterInfo.uMovementType; 848 v0 = pActors;//[0].pMonsterInfo.uMovementType;
829 do 849 do
830 { 850 {
831 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != 4 && v0->pMonsterInfo.uMovementType != 5 ) 851 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long && v0->pMonsterInfo.uMovementType != 5 )
832 { 852 {
833 v1 = abs(v0->vPosition.x - pParty->vPosition.x); 853 v1 = abs(v0->vPosition.x - pParty->vPosition.x);
834 v2 = abs(v0->vPosition.y - pParty->vPosition.y); 854 v2 = abs(v0->vPosition.y - pParty->vPosition.y);
835 v3 = abs(v0->vPosition.z - pParty->vPosition.z); 855 v3 = abs(v0->vPosition.z - pParty->vPosition.z);
836 if (int_get_vector_length(v1, v2, v3) < 512) 856 if (int_get_vector_length(v1, v2, v3) < 512)
1013 1033
1014 assert(sizeof(NPCData) == 0x4C); 1034 assert(sizeof(NPCData) == 0x4C);
1015 memset(hireling, 0, sizeof(*hireling)); 1035 memset(hireling, 0, sizeof(*hireling));
1016 1036
1017 pParty->field_709 = 0; 1037 pParty->field_709 = 0;
1018 Party__CountHirelings(); 1038 pParty->CountHirelings();
1019 viewparams->bRedrawGameUI = 1; 1039 viewparams->bRedrawGameUI = true;
1020 } 1040 }
1021 } 1041 }
1022 } 1042 }
1023 1043
1024 //----- (00490D02) -------------------------------------------------------- 1044 //----- (00490D02) --------------------------------------------------------