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;
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 {
528 {
529 Error(
"Weapon.OnStoreLoad cannot load jamming state");
530 return false;
531 }
532 }
533
535 {
536 if (!
m_fsm.OnStoreLoad(ctx, version))
537 return false;
538
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)
proto bool Read(void value_in)
bool m_isJammed
weapon state machine
ref WeaponFSM m_fsm
weapon abilities
void Error(string err)
Messagebox with error message.