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

◆ SetWaterQuantity()

void ItemBase::SetWaterQuantity ( int slotIndex,
int value )
inlineprivate

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

934 {
935 int bitsPerSlot = 8;
936 int slotsPerInt = 32 / bitsPerSlot;
937
938 int groupIndex = slotIndex / slotsPerInt;
939 int bitOffset = (slotIndex % slotsPerInt) * bitsPerSlot;
940
941 int mask = 255 << bitOffset;
942 value = Math.Clamp(value, 0, 200);
943
944 int temp = GetWaterBitmapByIndex(groupIndex);
945 temp &= ~mask;
946 temp |= (value << bitOffset);
947 SetWaterBitmapByIndex(groupIndex, temp);
948 }
int GetWaterBitmapByIndex(int index)
Определения GardenBase.c:919
void SetWaterBitmapByIndex(int index, int value)
Определения GardenBase.c:903

Перекрестные ссылки Math::Clamp(), GetWaterBitmapByIndex() и SetWaterBitmapByIndex().

Используется в InitializeSlots(), OnStoreLoad() и RemoveSlot().