Iterate through given body part and calculates heatcofort and item heat value.
1354 {
1355 pHeatComfort = 0;
1356 pHeat = 0;
1357
1358 int attCount =
m_Player.GetInventory().AttachmentCount();
1359 for (int attIdx = 0; attIdx < attCount; ++attIdx)
1360 {
1361 EntityAI attachment =
m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
1362 if (attachment.IsClothing())
1363 {
1365 int attachmentSlot = attachment.GetInventory().GetSlotId(0);
1366
1367 if (attachmentSlot == pBodyPartId)
1368 {
1369 #ifdef ENABLE_LOGGING
1371 #endif
1372
1373 float itemHeatcomfort = 0;
1374 float itemTemperature = 0;
1375
1376
1377 int inventoryAttCount = item.GetInventory().AttachmentCount();
1378 if (inventoryAttCount > 0)
1379 {
1380 #ifdef ENABLE_LOGGING
1381 LogItemHeat(string.Format("attachments:"), false);
1382 #endif
1383 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
1384 {
1385 EntityAI inAttachment = item.GetInventory().GetAttachmentFromIndex(inAttIdx);
1387 if (attachmentItem && attachmentItem.CanHaveTemperature())
1388 {
1389 itemTemperature = attachmentItem.GetTemperature();
1391 {
1392 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * attachmentItem.GetQuantityNormalizedScripted() * attachmentItem.GetTemperaturePerQuantityWeight();
1393 #ifdef ENABLE_LOGGING
1394 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", attachmentItem, itemTemperature, pHeat), true);
1395 #endif
1396 pHeat += itemHeatcomfort;
1397 }
1398 }
1399 }
1400 }
1401 if (item.GetInventory().GetCargo())
1402 {
1403 int inventoryItemCount = item.GetInventory().GetCargo().GetItemCount();
1404
1405 if (inventoryItemCount > 0)
1406 {
1407 #ifdef ENABLE_LOGGING
1408 LogItemHeat(string.Format("cargo:"), false);
1409 #endif
1410 for (int j = 0; j < inventoryItemCount; ++j)
1411 {
1412 ItemBase inventoryItem =
ItemBase.Cast(item.GetInventory().GetCargo().GetItem(j));
1413 if (inventoryItem && inventoryItem.CanHaveTemperature())
1414 {
1415 itemTemperature = inventoryItem.GetTemperature();
1417 {
1418 itemHeatcomfort =
NormalizedTemperature(itemTemperature) * inventoryItem.GetQuantityNormalizedScripted() * inventoryItem.GetTemperaturePerQuantityWeight();
1419 #ifdef ENABLE_LOGGING
1420 LogItemHeat(string.Format("%1: temperature=%2 heat=%3", inventoryItem, itemTemperature, itemHeatcomfort), true);
1421 #endif
1422 pHeat += itemHeatcomfort;
1423 }
1424 }
1425 }
1426 }
1427 }
1428
1429 pHeatComfort = MiscGameplayFunctions.GetCurrentItemHeatIsolation(item) * pCoef;
1430
1431 #ifdef ENABLE_LOGGING
1432 LogItemHeat(string.Format("overall heat from items=%1 (coef applied)", pHeat));
1433 LogItemHeat("");
1434 #endif
1435
1436 break;
1437 }
1438 }
1439 }
1440 }
float NormalizedTemperature(float temperature, float lowerLimit=GameConstants.ENVIRO_LOW_TEMP_LIMIT, float upperLimit=GameConstants.ENVIRO_HIGH_TEMP_LIMIT)
provides access to slot configuration
const float ITEM_TEMPERATURE_NEUTRAL_ZONE_UPPER_LIMIT