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;
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 {
534 {
535 Error(
"Weapon.OnStoreLoad cannot load jamming state");
536 return false;
537 }
538 }
539
541 {
542 if (!
m_fsm.OnStoreLoad(ctx, version))
543 return false;
544
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)
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.