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

◆ SlotWaterStateUpdate()

void ItemBase::SlotWaterStateUpdate ( Slot slot)
inlineprivate

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

520 {
521 int idx = slot.GetSlotIndex();
522 int mask = 1 << idx;
523 int currentState = (m_SlotWateredState >> idx) & 1;
524 int newState = slot.GetWateredState();
525 // Clear the relevant bit first
526 m_SlotWateredState &= ~mask;
527
528 // Set the bit state (1 for WET, 0 for DRY)
529 m_SlotWateredState |= (newState << idx);
530
531 if ((g_Game.IsServer() || !g_Game.IsMultiplayer()) && currentState != newState)
532 {
533 UpdateSlotTexture(slot.GetSlotIndex());
534
535 if (g_Game.IsServer())
536 SetSynchDirty();
537 }
538 }
DayZGame g_Game
Определения DayZGame.c:3868
int m_SlotWateredState
Определения GardenBase.c:28
void UpdateSlotTexture(int slot_index)
This should be only called on server as the selections are synced to clients in C++.
Определения GardenBase.c:563

Перекрестные ссылки g_Game, m_SlotWateredState и UpdateSlotTexture().