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

◆ OnStoreLoad()

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

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

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