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

◆ OnItemLocationChanged()

override void Weapon::OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
inlineprotected

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

1149 {
1150 /*
1151 // TODO(kumarjac): Solve this in code instead, OnItemLocationChanged is called too late.
1152 // Maybe extend an option for items to specify what attachments they must
1153 // be synchronized with? Moving to 'DelayedValidateAndRepair' works for now.
1154 int muzzles = GetMuzzleCount();
1155 for (int muzzleIdx = 0; muzzleIdx < muzzles; muzzleIdx++)
1156 {
1157 Magazine mag = GetMagazine(muzzleIdx);
1158 Print(mag);
1159 if (!mag)
1160 continue;
1161
1162 Print(mag.GetInventory());
1163 if (!mag.GetInventory())
1164 continue;
1165
1166 InventoryLocation invLoc = new InventoryLocation();
1167 mag.GetInventory().GetCurrentInventoryLocation(invLoc);
1168
1169 GetGame().AddInventoryJunctureEx(null, this, invLoc, true, 1000);
1170 }
1171 */
1172
1173 super.OnItemLocationChanged(old_owner,new_owner);
1174
1175 // "resets" optics memory on optics
1176 PlayerBase player;
1177 if (PlayerBase.CastTo(player,old_owner))
1178 {
1179 player.SetReturnToOptics(false);
1180
1181 //optics item state reset
1182 ItemOptics optics;
1183 if (Class.CastTo(optics,GetAttachedOptics()))
1184 {
1185 player.SwitchOptics(optics,false);
1186 }
1187 }
1188
1189 if (old_owner != new_owner && PlayerBase.Cast(new_owner))
1190 SetWasIronSight(true); // reset ironsight/optic default
1191
1192 HideWeaponBarrel(false);
1193 }
StarlightOptic ItemOptics
void SetWasIronSight(bool state)
Определения Weapon_Base.c:1366
void HideWeaponBarrel(bool state)
Определения Weapon_Base.c:2126

Перекрестные ссылки Class::CastTo(), HideWeaponBarrel() и SetWasIronSight().