DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ EquipDefaultCharacter()

void MenuDefaultCharacterData::EquipDefaultCharacter ( Man player)
inlineprivate

См. определение в файле gameplay.c строка 1034

1035 {
1036 if (!player)
1037 {
1038 ErrorEx("WARNING - trying to equip non-existent object! | MenuDefaultCharacterData::EquipDefaultCharacter");
1039 return;
1040 }
1041
1042 int slot_ID;
1043 string attachment_type;
1044 string current_attachment_type;
1045 EntityAI current_attachment_object;
1046
1047 GameInventory playerInventory = player.GetInventory();
1048 for (int i = 0; i < m_AttachmentsMap.Count(); ++i)
1049 {
1050 attachment_type = "";
1051 current_attachment_type = "";
1052 slot_ID = m_AttachmentsMap.GetKey(i);
1053 attachment_type = m_AttachmentsMap.GetElement(i); //Get(i)
1054 current_attachment_object = playerInventory.FindAttachment(slot_ID);
1055
1056 if (current_attachment_object)
1057 {
1058 current_attachment_type = current_attachment_object.GetType();
1059 }
1060 if (current_attachment_type != attachment_type)
1061 {
1062 if (current_attachment_object)
1063 g_Game.ObjectDelete(current_attachment_object);
1064 if (attachment_type != "")
1065 playerInventory.CreateAttachmentEx(attachment_type,slot_ID);
1066 }
1067 }
1068 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
proto native EntityAI CreateAttachmentEx(string typeName, int slotId)
Create Entity of specified type as attachment of entity.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
ref map< int, string > m_AttachmentsMap
Определения gameplay.c:989
enum ShapeType ErrorEx

Перекрестные ссылки GameInventory::CreateAttachmentEx(), ErrorEx, GameInventory::FindAttachment(), g_Game и m_AttachmentsMap.