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