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

◆ GuardCondition() [18/18]

override bool HandGuardBase::GuardCondition ( HandEventBase e)
inlineprotected

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

265 {
266 HandEventForceSwap es = HandEventForceSwap.Cast(e);
267 if (es)
268 {
269 if (LogManager.IsInventoryHFSMLogEnable())
270 {
271 hndDebugPrint("[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent FSwap e=" + e.DumpToString());
272 }
273
274 if (!es.m_Src2.IsValid() || !es.m_Src.IsValid())
275 {
276 Error("[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - invalid item source");
277 return false;
278 }
279
280 bool allow = e.m_IsJuncture || e.m_IsRemote;
281 if (allow == false)
282 {
283 if (GameInventory.CanSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Src2.GetItem()))
284 {
285 allow = true; // allow if ordinary swap
286 }
287 else if (es.m_Dst2)
288 {
289 if (GameInventory.CanForceSwapEntitiesEx(es.GetSrc().GetItem(), es.m_Dst, es.m_Src2.GetItem(), es.m_Dst2) == false)
290 {
291 Error("[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - no room at dst=" + InventoryLocation.DumpToStringNullSafe(es.m_Dst2));
292 }
293 else
294 {
295 allow = true;
296 }
297 }
298 }
299
300 if (allow)
301 {
302 int animType1 = -1;
303 int animType2 = -1;
304 if (ProcessSwapEvent(e, animType1, animType2))
305 {
306 e.m_AnimationID = animType1;
307 es.m_Animation2ID = animType2;
308 return true;
309 }
310 }
311 else
312 {
313 Error("[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - m_HasRoomGuard.GuardCondition failed");
314 }
315 }
316 else
317 {
318 Error("[hndfsm] HandSelectAnimationOfForceSwapInHandsEvent - not a swap event");
319 }
320 return false;
321 }
void hndDebugPrint(string s)
Определения HandFSM.c:1
override string DumpToString()
Определения Hand_Events.c:333
int m_Animation2ID
destination for old item that was in hands
Определения Hand_Events.c:561
bool ProcessSwapEvent(notnull HandEventBase e, out int animType1, out int animType2)
Определения HandAnimated_Guards.c:255
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки GameInventory::CanForceSwapEntitiesEx(), GameInventory::CanSwapEntitiesEx(), HandEventBase::DumpToString(), InventoryLocation::DumpToStringNullSafe(), Error(), hndDebugPrint(), LogManager::IsInventoryHFSMLogEnable(), HandEventBase::m_Animation2ID и ProcessSwapEvent().