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

◆ OnItemLocationChanged()

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

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

1124 {
1125 /*
1126 // TODO(kumarjac): Solve this in code instead, OnItemLocationChanged is called too late.
1127 // Maybe extend an option for items to specify what attachments they must
1128 // be synchronized with? Moving to 'DelayedValidateAndRepair' works for now.
1129 int muzzles = GetMuzzleCount();
1130 for (int muzzleIdx = 0; muzzleIdx < muzzles; muzzleIdx++)
1131 {
1132 Magazine mag = GetMagazine(muzzleIdx);
1133 Print(mag);
1134 if (!mag)
1135 continue;
1136
1137 Print(mag.GetInventory());
1138 if (!mag.GetInventory())
1139 continue;
1140
1141 InventoryLocation invLoc = new InventoryLocation();
1142 mag.GetInventory().GetCurrentInventoryLocation(invLoc);
1143
1144 GetGame().AddInventoryJunctureEx(null, this, invLoc, true, 1000);
1145 }
1146 */
1147
1148 super.OnItemLocationChanged(old_owner,new_owner);
1149
1150 // "resets" optics memory on optics
1151 PlayerBase player;
1152 if (PlayerBase.CastTo(player,old_owner))
1153 {
1154 player.SetReturnToOptics(false);
1155
1156 //optics item state reset
1157 ItemOptics optics;
1158 if (Class.CastTo(optics,GetAttachedOptics()))
1159 {
1160 player.SwitchOptics(optics,false);
1161 }
1162 }
1163
1164 if (old_owner != new_owner && PlayerBase.Cast(new_owner))
1165 SetWasIronSight(true); // reset ironsight/optic default
1166
1167 HideWeaponBarrel(false);
1168 }
void SetWasIronSight(bool state)
Определения Weapon_Base.c:1328
void HideWeaponBarrel(bool state)
Определения Weapon_Base.c:1827

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