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

◆ OnStoreLoad()

override bool Weapon::OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

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

490 {
491 if ( !super.OnStoreLoad(ctx, version) )
492 return false;
493
494
495 if (version >= 113)
496 {
497 int current_muzzle = 0;
498 if (!ctx.Read(current_muzzle))
499 {
500 Error("Weapon.OnStoreLoad " + this + " cannot read current muzzle!");
501 return false;
502 }
503
504 if (current_muzzle >= GetMuzzleCount() || current_muzzle < 0)
505 Error("Weapon.OnStoreLoad " + this + " trying to set muzzle index " + current_muzzle + " while it only has " + GetMuzzleCount() + " muzzles!");
506 else
507 SetCurrentMuzzle(current_muzzle);
508 }
509
510 if (version >= 105)
511 {
512 int mode_count = 0;
513 if (!ctx.Read(mode_count))
514 {
515 Error("Weapon.OnStoreLoad " + this + " cannot read mode count!");
516 return false;
517 }
518
519 for (int m = 0; m < mode_count; ++m)
520 {
521 int mode = 0;
522 if (!ctx.Read(mode))
523 {
524 Error("Weapon.OnStoreLoad " + this + " cannot read mode[" + m + "]");
525 return false;
526 }
527
528 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(this) + " OnStoreLoad - loaded muzzle[" + m + "].mode = " + mode); }
529 SetCurrentMode(m, mode);
530 }
531 }
532
533 if ( version >= 106 )
534 {
535 if ( !ctx.Read(m_isJammed) )
536 {
537 Error("Weapon.OnStoreLoad cannot load jamming state");
538 return false;
539 }
540 }
541
542 if (m_fsm)
543 {
544 if (!m_fsm.OnStoreLoad(ctx, version))
545 return false;
546
547 WeaponStableState wss = WeaponStableState.Cast(m_fsm.GetCurrentState());
548 if (wss)
549 {
550 SetGroundAnimFrameIndex(wss.m_animState);
551 }
552
553 }
554 else
555 {
556 int dummy = 0;
557 if (!ctx.Read(dummy))
558 return false;
559 }
560
561 return true;
562 }
void wpnDebugPrint(string s)
void WeaponStableState(Weapon_Base w=NULL, WeaponStateBase parent=NULL, int anim_state=-1)
Определения WeaponStableState.c:32
proto bool Read(void value_in)
bool m_isJammed
weapon state machine
Определения Weapon_Base.c:50
ref WeaponFSM m_fsm
weapon abilities
Определения Weapon_Base.c:49
class LOD Object
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки Error(), LogManager::IsWeaponLogEnable(), m_fsm, m_isJammed, Serializer::Read() и wpnDebugPrint().