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

◆ PrepareLocations()

bool ReplaceItemWithNewLambdaBase::PrepareLocations ( )
inlineprotected

Step A. - prepare inventory locations.

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

44 {
45 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] ReplaceItemWithNewLambdaBase Step A) Prepare inventory locations, old_item=" + m_OldItem);
46 m_OldLocation = new InventoryLocation;
47 if (m_OldItem.GetInventory().GetCurrentInventoryLocation(m_OldLocation)) // A.1) store old location
48 {
49 if (m_NewLocation == null)
50 {
51 m_NewLocation = new InventoryLocation;
52 m_NewLocation.CopyLocationFrom(m_OldLocation, true); // A.2) prepare new location from old
53
54 //setting proper location type for ground pos
55 if (!m_NewLocation.GetParent())
56 {
57 vector m4[4];
58 Math3D.MatrixIdentity4(m4);
59 m4[3] = m_NewLocation.GetPos();
60 string path = "" + CFG_VEHICLESPATH + " " + m_NewItemType + " inherit_rotation";
61 bool keep_rotation = GetGame().ConfigIsExisting(path) && GetGame().ConfigGetInt(path) > 0;
62
63 if (m_OldLocation.GetType() == InventoryLocationType.GROUND && keep_rotation)
64 {
65 float dir[4];
66 m_OldLocation.GetDir(dir);
67 m_NewLocation.SetGroundEx(null,m_NewLocation.GetPos(),dir);
68 }
69 else
70 {
71 m_NewLocation.SetGround(null,m4);
72 }
73 }
74 }
75 return true;
76 }
77 else
78 Error("[inv] ReplaceItemWithNewLambdaBase Step A.1) failed to get old_item inventory location");
79 return false;
80 }
void hndDebugPrint(string s)
Определения HandFSM.c:1
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
string path
Определения OptionSelectorMultistate.c:142
proto native bool ConfigIsExisting(string path)
proto native int ConfigGetInt(string path)
Get int value from config on path.
ref InventoryLocation m_OldLocation
Определения ReplaceItemWithNewLambdaBase.c:8
ref InventoryLocation m_NewLocation
Определения ReplaceItemWithNewLambdaBase.c:9
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
const string CFG_VEHICLESPATH
Определения constants.c:220

Перекрестные ссылки CFG_VEHICLESPATH, CGame::ConfigGetInt(), CGame::ConfigIsExisting(), Error(), GetGame(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), m_NewItemType, m_NewLocation, m_OldItem, m_OldLocation, Math3D::MatrixIdentity4() и path.

Используется в Execute().