Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
weaponchamberinglooped.c
Go to the documentation of this file.
1 // load x bullets
2 class LoopedChambering_EndLoop extends WeaponStartAction
3 {
4  override bool IsWaitingForActionFinish () { return true; }
5 };
6 
7 class LoopedChambering_Wait4ShowBullet2 extends WeaponStateBase
8 {
9  override bool IsWaitingForActionFinish () { return false; }
10 };
11 
12 class LoopedChambering extends WeaponStateBase
13 {
16  int m_endActionType;
17  Magazine m_srcMagazine;
19 
23  ref LoopedChambering_Wait4ShowBullet2 m_w4sb2;
25  ref BulletHide_W4T m_hideB;
26 
27  void LoopedChambering (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int startActionType = -1, int endActionType = -1)
28  {
29  m_action = action;
30  m_startActionType = startActionType;
31  m_endActionType = endActionType;
32 
33  // setup nested state machine
34  m_start = new WeaponChambering_Start(m_weapon, this, m_action, m_startActionType);
35  m_eject = new WeaponEjectCasing(m_weapon, this);
36  m_chamber = new WeaponChambering_Cartridge_ChambToMag(m_weapon, this);
37  m_w4sb2 = LoopedChambering_Wait4ShowBullet2(m_weapon, this);
38  m_hideB = new BulletHide_W4T(m_weapon, this);
39  m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
40  // events
41  WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
42  WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
43  WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
44  WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
45  WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
46  WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
47  WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
48  WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
49 
50  m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
51  m_fsm.AddTransition(new WeaponTransition(m_start, __be_, m_eject));
52  m_fsm.AddTransition(new WeaponTransition(m_start, __bs_, m_chamber));
53  m_fsm.AddTransition(new WeaponTransition(m_eject, __bs_, m_chamber));
54 
55 
56  m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_w4sb2, NULL, new GuardAnd(new GuardAnd(new WeaponGuardHasAmmoInLoopedState(m_chamber), new WeaponGuardInternalMagazineHasRoomForBullet(m_weapon)),new WeaponGuardWeaponManagerWantContinue())));
57  m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
58  m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
59  m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
60 
61  m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
62 
63  // Safety exits
64  m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
65  m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
66  m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
67  m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
68  m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
69 
70  m_fsm.SetInitialState(m_start);
71  }
72 
73  override void OnEntry (WeaponEventBase e)
74  {
75  if (e != NULL)
76  {
77 
78  m_srcMagazine = e.m_magazine;
79  if (m_srcMagazine != NULL)
80  {
81  m_weapon.SelectionBulletHide();
83  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
84 
86 
87  // move to LH
89  lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
90  if (GameInventory.LocationSyncMoveEntity(newSrc, lhand))
91  {
92  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from inv (inv->LHand)"); }
93  }
94  else
95  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from inv");
96 
97  m_chamber.m_srcMagazine = m_srcMagazine;
98  }
99  else
100  {
101  Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering m_srcMagazine = NULL");
102  }
103  }
104  else
105  {
106  Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
107  }
108 
109  super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
110  }
111  override void OnExit (WeaponEventBase e)
112  {
113  bool done = false;
114  if (m_srcMagazine)
115  {
116  e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
117 
118  InventoryLocation leftHandIl = new InventoryLocation;
119  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
120  if (leftHandIl.IsValid())
121  {
123  {
124  if (vector.DistanceSq(m_srcMagazinePrevLocation.GetPos(), leftHandIl.GetPos()) < WeaponManager.MAX_DROP_MAGAZINE_DISTANCE_SQ)
125  {
126  if (GameInventory.LocationCanMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
127  {
128  if (GameInventory.LocationSyncMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
129  {
130  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
131  done = true;
132  }
133  }
134  }
135  }
136 
137  if( !done)
138  {
140  e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
141 
142  if(!il || !il.IsValid())
143  {
144  if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
145  {
146  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - exit"); }
147  }
148  else
149  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
150 
151  }
152  else
153  {
154  if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
155  {
156  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
157  }
158  else
159  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - exit");
160  }
161  }
162  }
163  }
164 
165  super.OnExit(e);
166  m_srcMagazine = NULL;
167  m_chamber.m_srcMagazine = NULL;
169  }
170  override void OnAbort (WeaponEventBase e)
171  {
172  bool done = false;
173  if (m_srcMagazine)
174  {
175  e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
176 
177  InventoryLocation leftHandIl = new InventoryLocation;
178  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
179  if (leftHandIl.IsValid())
180  {
182  {
183  if (vector.DistanceSq(m_srcMagazinePrevLocation.GetPos(), leftHandIl.GetPos()) < WeaponManager.MAX_DROP_MAGAZINE_DISTANCE_SQ)
184  {
185  if (GameInventory.LocationCanMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
186  {
187  if (GameInventory.LocationSyncMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
188  {
189  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
190  done = true;
191  }
192  }
193  }
194  }
195 
196  if( !done)
197  {
199  e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
200 
201  if(!il || !il.IsValid())
202  {
203  if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
204  {
205  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - no inventory space for ammo pile - dropped to ground - abort"); }
206  }
207  else
208  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
209 
210  }
211  else
212  {
213  if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
214  {
215  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
216  }
217  else
218  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering, error - cannot remove ammo pile from wpn - abort");
219  }
220  }
221  }
222  }
223 
224  super.OnAbort(e);
225  m_srcMagazine = NULL;
226  m_chamber.m_srcMagazine = NULL;
228  }
229 
230  override bool SaveCurrentFSMState (ParamsWriteContext ctx)
231  {
232  if (!super.SaveCurrentFSMState(ctx))
233  return false;
234 
235  if (!ctx.Write(m_srcMagazine))
236  {
237  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
238  return false;
239  }
240 
242  {
243  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
244  return false;
245  }
246 
247  return true;
248  }
249 
250  override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
251  {
252  if (!super.LoadCurrentFSMState(ctx, version))
253  return false;
254 
255  if (!ctx.Read(m_srcMagazine))
256  {
257  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
258  return false;
259  }
260 
262  {
263  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChambering.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
264  return false;
265  }
266  return true;
267  }
268 };
269 
270 class LoopedChamberingEjectLast extends WeaponStateBase
271 {
273  int m_startActionType;
274  int m_endActionType;
275  Magazine m_srcMagazine;
277 
281  ref LoopedChambering_Wait4ShowBullet2 m_w4sb2;
283  ref BulletHide_W4T m_hideB;
284  ref WeaponChamberFromInnerMag_W4T m_chamberFromInnerMag;
285 
286  void LoopedChamberingEjectLast (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int startActionType = -1, int endActionType = -1)
287  {
288  m_action = action;
289  m_startActionType = startActionType;
290  m_endActionType = endActionType;
291 
292  // setup nested state machine
293  m_start = new WeaponChambering_Start(m_weapon, this, m_action, m_startActionType);
294  m_eject = new WeaponEjectCasing(m_weapon, this);
295  m_chamber = new WeaponChambering_Cartridge_InnerMag(m_weapon, this);
296  m_w4sb2 = new LoopedChambering_Wait4ShowBullet2(m_weapon, this);
297  m_hideB = new BulletHide_W4T(m_weapon, this);
298  m_chamberFromInnerMag = new WeaponChamberFromInnerMag_W4T(m_weapon, this);
299  m_endLoop = new LoopedChambering_EndLoop(m_weapon, this, m_action, m_endActionType); // @NOTE: termination playing action - dummy?
300  // events
301  WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
302  WeaponEventContinuousLoadBulletStart __lS_ = new WeaponEventContinuousLoadBulletStart;
303  WeaponEventContinuousLoadBulletEnd __lE_ = new WeaponEventContinuousLoadBulletEnd;
304  WeaponEventAnimCocked __wc_ = new WeaponEventAnimCocked;
305  WeaponEventAnimBulletShow __bs_ = new WeaponEventAnimBulletShow;
306  WeaponEventAnimBulletHide __bh_ = new WeaponEventAnimBulletHide;
307  WeaponEventAnimBulletEject __be_ = new WeaponEventAnimBulletEject;
308  WeaponEventAnimBulletInMagazine __bM_ = new WeaponEventAnimBulletInMagazine;
309  WeaponEventAnimBulletShow2 _bs2_ = new WeaponEventAnimBulletShow2;
310 
311  m_fsm = new WeaponFSM(this); // @NOTE: set owner of the submachine fsm
312  m_fsm.AddTransition(new WeaponTransition(m_start , __bs_, m_chamber));
313 
314 
315  m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_w4sb2, NULL, new GuardAnd(new GuardAnd(new WeaponGuardHasAmmoInLoopedState(m_chamber), new WeaponGuardInternalMagazineHasRoomForBullet(m_weapon)),new WeaponGuardWeaponManagerWantContinue())));
316  m_fsm.AddTransition(new WeaponTransition(m_chamber, __bM_, m_endLoop));
317  m_fsm.AddTransition(new WeaponTransition(m_w4sb2, __bh_, m_hideB));
318  m_fsm.AddTransition(new WeaponTransition(m_hideB, __bs_, m_chamber));
319 
320  m_fsm.AddTransition(new WeaponTransition(m_endLoop, _fin_, NULL));
321 
322  m_fsm.AddTransition(new WeaponTransition(m_hideB, __be_, m_eject));
323  m_fsm.AddTransition(new WeaponTransition(m_endLoop, __be_, m_eject));
324  m_fsm.AddTransition(new WeaponTransition(m_eject, __wc_, m_chamberFromInnerMag));
325  m_fsm.AddTransition(new WeaponTransition(m_chamberFromInnerMag, _fin_, NULL));
326 
327  // Safety exits
328  m_fsm.AddTransition(new WeaponTransition(m_hideB, _fin_, null));
329  m_fsm.AddTransition(new WeaponTransition(m_w4sb2, _fin_, null));
330  m_fsm.AddTransition(new WeaponTransition(m_chamber, _fin_, null));
331  m_fsm.AddTransition(new WeaponTransition(m_eject , _fin_, null));
332  m_fsm.AddTransition(new WeaponTransition(m_start , _fin_, null));
333 
334  m_fsm.SetInitialState(m_start);
335  }
336 
337  override void OnEntry (WeaponEventBase e)
338  {
339  if (e != NULL)
340  {
341  m_srcMagazine = e.m_magazine;
342  if (m_srcMagazine != NULL)
343  {
345  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(newSrc);
346 
347  m_srcMagazinePrevLocation = newSrc;
348 
349  // move to LH
351  lhand.SetAttachment(e.m_player, m_srcMagazine, InventorySlots.LEFTHAND);
352  if (GameInventory.LocationSyncMoveEntity(newSrc, lhand))
353  {
354  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from inv (inv->LHand)"); }
355  }
356  else
357  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from inv");
358 
359  m_chamber.m_srcMagazine = m_srcMagazine;
360  }
361  else
362  {
363  Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast m_srcMagazine = NULL");
364  }
365  }
366  else
367  {
368  Print("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast (e=NULL), m_srcMagazine=" + m_srcMagazine.ToString());
369  }
370 
371  super.OnEntry(e); // @NOTE: super at the end (prevent override from submachine start)
372  }
373  override void OnExit (WeaponEventBase e)
374  {
375  bool done = false;
376  if (m_srcMagazine)
377  {
378  e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
379 
380  InventoryLocation leftHandIl = new InventoryLocation;
381  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
382  if (leftHandIl.IsValid())
383  {
385  {
386  if (vector.DistanceSq(m_srcMagazinePrevLocation.GetPos(), leftHandIl.GetPos()) < WeaponManager.MAX_DROP_MAGAZINE_DISTANCE_SQ)
387  {
388  if (GameInventory.LocationCanMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
389  {
390  if (GameInventory.LocationSyncMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
391  {
392  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - exit"); }
393  done = true;
394  }
395  }
396  }
397  }
398 
399  if (!done)
400  {
402  e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
403 
404  if (!il || !il.IsValid())
405  {
406  if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
407  {
408  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - exit"); }
409  }
410  else
411  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - exit");
412 
413  }
414  else
415  {
416  if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
417  {
418  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - exit"); }
419  }
420  else
421  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - exit");
422  }
423  }
424  }
425  }
426 
427  super.OnExit(e);
428  m_srcMagazine = NULL;
429  m_chamber.m_srcMagazine = NULL;
431  }
432  override void OnAbort (WeaponEventBase e)
433  {
434  bool done = false;
435  if (m_srcMagazine)
436  {
437  e.m_player.GetInventory().ClearInventoryReservationEx( m_srcMagazine , m_srcMagazinePrevLocation );
438 
439  InventoryLocation leftHandIl = new InventoryLocation;
440  m_srcMagazine.GetInventory().GetCurrentInventoryLocation(leftHandIl);
441  if (leftHandIl.IsValid())
442  {
444  {
445  if (vector.DistanceSq(m_srcMagazinePrevLocation.GetPos(), leftHandIl.GetPos()) < WeaponManager.MAX_DROP_MAGAZINE_DISTANCE_SQ)
446  {
447  if (GameInventory.LocationCanMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
448  {
449  if (GameInventory.LocationSyncMoveEntity(leftHandIl,m_srcMagazinePrevLocation))
450  {
451  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand to previous location (LHand->inv) - abort"); }
452  done = true;
453  }
454  }
455  }
456  }
457 
458  if (!done)
459  {
461  e.m_player.GetInventory().FindFreeLocationFor( m_srcMagazine, FindInventoryLocationType.CARGO, il );
462 
463  if (!il || !il.IsValid())
464  {
465  if (DayZPlayerUtils.HandleDropMagazine(e.m_player, m_srcMagazine))
466  {
467  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - no inventory space for ammo pile - dropped to ground - abort"); }
468  }
469  else
470  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot drop ammo pile from left hand after not found inventory space for ammo pile - abort");
471 
472  }
473  else
474  {
475  if (GameInventory.LocationSyncMoveEntity(leftHandIl, il))
476  {
477  if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, ok - ammo pile removed from left hand (LHand->inv) - abort"); }
478  }
479  else
480  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast, error - cannot remove ammo pile from wpn - abort");
481  }
482  }
483  }
484  }
485 
486  super.OnAbort(e);
487  m_srcMagazine = NULL;
488  m_chamber.m_srcMagazine = NULL;
490  }
491 
492  override bool SaveCurrentFSMState (ParamsWriteContext ctx)
493  {
494  if (!super.SaveCurrentFSMState(ctx))
495  return false;
496 
497  if (!ctx.Write(m_srcMagazine))
498  {
499  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot save m_srcMagazine for weapon=" + m_weapon);
500  return false;
501  }
502 
504  {
505  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.SaveCurrentFSMState: cannot write m_srcMagazinePrevLocation for weapon=" + m_weapon);
506  return false;
507  }
508  return true;
509  }
510 
511  override bool LoadCurrentFSMState (ParamsReadContext ctx, int version)
512  {
513  if (!super.LoadCurrentFSMState(ctx, version))
514  return false;
515 
516  if (!ctx.Read(m_srcMagazine))
517  {
518  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazine for weapon=" + m_weapon);
519  return false;
520  }
521 
523  {
524  Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " LoopedChamberingEjectLast.LoadCurrentFSMState: cannot read m_srcMagazinePrevLocation for weapon=" + m_weapon);
525  return false;
526  }
527  return true;
528  }
529 };
LoadCurrentFSMState
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
Definition: weaponchambering.c:867
Error
void Error(string err)
Messagebox with error message.
Definition: endebug.c:90
m_srcMagazine
Magazine m_srcMagazine
Definition: weaponchambering.c:634
OnAbort
override void OnAbort()
Definition: remotedetonator.c:300
LogManager
Definition: debug.c:734
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
DayZPlayerUtils
private void DayZPlayerUtils()
cannot be instantiated
Definition: dayzplayerutils.c:461
OptionalLocationReadFromContext
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
Definition: inventorylocation.c:605
OnExit
override void OnExit(HandEventBase e)
Definition: hand_states.c:28
wpnDebugPrint
void wpnDebugPrint(string s)
Definition: debug.c:9
m_eject
ref WeaponEjectCasingMultiMuzzle m_eject
Definition: weaponchambering.c:638
m_startActionType
int m_startActionType
Definition: weaponchambering.c:632
m_w4sb2
ref LoopedChambering_Wait4ShowBullet2 m_w4sb2
Definition: weaponchambering.c:641
Print
proto void Print(void var)
Prints content of variable to console/log.
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
m_chamber
ref WeaponChambering_Base m_chamber
Definition: weaponchambering.c:639
m_action
class WeaponEndAction extends WeaponStartAction m_action
WeaponStartAction
simple class starting animation action specified by m_action and m_actionType
Definition: weaponchambering.c:2
WeaponChambering_Base
Definition: weaponchambering.c:85
WeaponActions
WeaponActions
actions
Definition: human.c:808
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
OptionalLocationWriteToContext
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
Definition: inventorylocation.c:583
IsWaitingForActionFinish
class WeaponChambering_Cartridge_InnerMag extends WeaponChambering_Base IsWaitingForActionFinish
Definition: weaponchambering.c:190
vector
Definition: enconvert.c:105
m_start
ref WeaponStateBase m_start
Definition: weaponchambering.c:637
SaveCurrentFSMState
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
Definition: weaponchambering.c:848
Object
Definition: objecttyped.c:1
WeaponTransition
enum FSMTransition WeaponTransition
FindInventoryLocationType
FindInventoryLocationType
flags for searching locations in inventory
Definition: inventorylocation.c:15
m_endActionType
int m_endActionType
Definition: weaponchambering.c:633
m_endLoop
ref WeaponEndAction m_endLoop
Definition: weaponchambering.c:642
WeaponEventBase
signalize mechanism manipulation
Definition: events.c:34
WeaponStateBase
represent weapon state base
Definition: bullethide.c:1
m_weapon
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition: guards.c:583
Weapon_Base
shorthand
Definition: boltactionrifle_base.c:5
WeaponFSM
weapon finite state machine
WeaponEjectCasing
Definition: weaponejectcasingandchamberfromattmag.c:126
m_srcMagazinePrevLocation
ref InventoryLocation m_srcMagazinePrevLocation
source of the cartridge
Definition: weaponchambering.c:635
OnEntry
HandStateEquipped OnEntry
Definition: weaponchambering.c:208
GameInventory
script counterpart to engine's class Inventory
Definition: inventory.c:78
WeaponManager
Definition: weaponmanager.c:1