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

◆ OnStoreLoad()

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

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

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