1036 {
1037 if (!player)
1038 {
1039 ErrorEx(
"WARNING - trying to equip non-existent object! | MenuDefaultCharacterData::EquipDefaultCharacter");
1040 return;
1041 }
1042
1043 int slot_ID;
1044 string attachment_type;
1045 string current_attachment_type;
1046 EntityAI current_attachment_object;
1047
1049 {
1050 attachment_type = "";
1051 current_attachment_type = "";
1054 current_attachment_object = player.GetInventory().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 player.GetInventory().CreateAttachmentEx(attachment_type,slot_ID);
1066 }
1067 }
1068 }