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

◆ EEOnAfterLoad()

void Entity::EEOnAfterLoad ( )
inlineprotected

Called when entity is part of "connected system" and being restored after load.

См. определение в файле 3_Game/DayZ/Entities/EntityAI.c строка 1381

1382 {
1383 // ENERGY MANAGER
1384 // Restore connections between devices which were connected before server restart
1385 if ( m_EM && m_EM.GetRestorePlugState() )
1386 {
1387 int b1 = m_EM.GetEnergySourceStorageIDb1();
1388 int b2 = m_EM.GetEnergySourceStorageIDb2();
1389 int b3 = m_EM.GetEnergySourceStorageIDb3();
1390 int b4 = m_EM.GetEnergySourceStorageIDb4();
1391
1392 // get pointer to EntityAI based on this ID
1393 EntityAI potential_energy_source = g_Game.GetEntityByPersitentID(b1, b2, b3, b4); // This function is available only in this event!
1394
1395 // IMPORTANT!
1396 // Object IDs acquired here become INVALID when electric devices are transfered to another server while in plugged state (like Flashlight plugged into its attachment 9V battery)
1397 // To avoid issues, these items must be excluded from this system of restoring plug state so they don't unintentionally plug to incorrect devices through these invalid IDs.
1398 // Therefore their plug state is being restored withing the EEItemAttached() event while being excluded by the following 'if' conditions...
1399
1400 bool is_attachment = false;
1401
1402 if (potential_energy_source)
1403 is_attachment = GetInventory().HasAttachment(potential_energy_source);
1404
1405 if ( !is_attachment && potential_energy_source )
1406 is_attachment = potential_energy_source.GetInventory().HasAttachment(this);
1407
1408 if ( potential_energy_source && potential_energy_source.GetCompEM() /*&& potential_energy_source.HasEnergyManager()*/ && !is_attachment )
1409 m_EM.PlugThisInto(potential_energy_source); // restore connection
1410 }
1411 }
DayZGame g_Game
Определения DayZGame.c:4074
proto native GameInventory GetInventory()
void EntityAI()
cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)
ComponentEnergyManager m_EM
proto native bool HasAttachment(notnull EntityAI e)
brief Returns True if entity is attached to this

Перекрестные ссылки EntityAI(), g_Game, GetInventory() и m_EM.