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

◆ OnItemLocationChanged()

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

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

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

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