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

◆ SwitchOn()

void ComponentEnergyManager::SwitchOn ( )
inlineprotected

Energy manager: Switches ON the device so it starts doing its work if it has enough energy.

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

372 {
374
375 if (g_Game.IsServer() || !g_Game.IsMultiplayer())
376 {
378 {
379 m_IsSwichedOn = true;
380 Synch();
381
382 DeviceUpdate(); // 'Wake up' this device now
383 StartUpdates();
384
385 // 'Wakes up' all connected devices
387
389
390 // Call event
391 g_Game.GameScript.CallFunction(m_ThisEntityAI, "OnSwitchOn", NULL, 0);
392 }
393 }
394
395 if ( !g_Game.IsServer() && g_Game.IsMultiplayer()/* && CanSwitchOn() */) // I want the CanSwitchOn() check, but when it's here, the OnSwitchOn() event is never called on client-side due to engine's synchronization system changing the m_IsSwichedOn to true without any specific event beign called. (Yes there is OnVariablesSynchronized() but that is called also when m_CanWork is synchronized, so I need to write a method of knowing when was this specific value changed.)
396 {
397 g_Game.GameScript.CallFunction(m_ThisEntityAI, "OnSwitchOn", NULL, 0);
398 }
399 }
DayZGame g_Game
Определения DayZGame.c:4074
EntityAI m_ThisEntityAI
Определения Component.c:24
void WakeUpWholeBranch(EntityAI original_caller)
Определения ComponentEnergyManager.c:1557
bool CanSwitchOn()
Energy manager: Checks if the device can be switched ON.
Определения ComponentEnergyManager.c:752
bool m_IsSwichedOnPreviousState
Определения ComponentEnergyManager.c:25

Перекрестные ссылки CanSwitchOn(), DeviceUpdate(), g_Game, m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StartUpdates(), Synch(), UpdateCanWork() и WakeUpWholeBranch().

Используется в Event_OnAwake() и TransferEntityVariables().