DayZ 1.24
Loading...
Searching...
No Matches
WeaponManager Class Reference
Collaboration diagram for WeaponManager:
[legend]

Protected Member Functions

void WeaponManager (PlayerBase player)
 
bool CanFire (Weapon_Base wpn)
 
bool CanAttachMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
 
bool CanSwapMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
 
bool CanDetachMagazine (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
 
bool CanLoadBullet (Weapon_Base wpn, Magazine mag, bool reservationCheck=true)
 
bool CanUnjam (Weapon_Base wpn, bool reservationCheck=true)
 
bool CanEjectBullet (Weapon_Base wpn, bool reservationCheck=true)
 
void SetEjectBulletTryTimestamp ()
 
bool InventoryReservation (Magazine mag, InventoryLocation invLoc)
 
bool AttachMagazine (Magazine mag, ActionBase control_action=NULL)
 
bool DetachMagazine (InventoryLocation invLoc, ActionBase control_action=NULL)
 
bool SwapMagazine (Magazine mag, ActionBase control_action=NULL)
 
bool SwapMagazineEx (Magazine mag, InventoryLocation invLoc, ActionBase control_action=NULL)
 
bool LoadBullet (Magazine mag, ActionBase control_action=NULL)
 
bool LoadMultiBullet (Magazine mag, ActionBase control_action=NULL)
 
void LoadMultiBulletStop ()
 
bool Unjam (ActionBase control_action=NULL)
 
bool EjectBullet (ActionBase control_action=NULL)
 
bool CanEjectBulletVerified ()
 
bool EjectBulletVerified (ActionBase control_action=NULL)
 
bool SetNextMuzzleMode ()
 
void Fire (Weapon_Base wpn)
 

Protected Attributes

PlayerBase m_player
 
int m_LastAcknowledgmentID
 
int m_PendingWeaponActionAcknowledgmentID
 
Magazine m_PendingTargetMagazine
 
ref InventoryLocation m_TargetInventoryLocation
 
int m_PendingWeaponAction
 
ref InventoryLocation m_PendingInventoryLocation
 
bool m_canEnd
 
bool m_justStart
 
bool m_InProgress
 
bool m_IsEventSended
 
bool m_WantContinue
 
bool m_InIronSight
 
bool m_InOptic
 
bool m_readyToStart
 
Weapon_Base m_WeaponInHand
 
MagazineStorage m_MagazineInHand
 
ActionBase m_ControlAction
 
int m_ForceEjectBulletTimestamp
 
const int FORCE_EJECT_BULLET_TIMEOUT = 2000
 
ref array< Magazinem_MagazinePilesInInventory
 
ref array< MagazineStorage > m_MagazineStorageInInventory
 
ref array< Magazinem_SuitableMagazines
 
Magazine m_PreparedMagazine
 
float m_NewJamChance
 
bool m_WaitToSyncJamChance
 
int m_AnimationRefreshCooldown
 

Private Member Functions

void Synchronize ()
 
void OnSyncJuncture (int pJunctureID, ParamsReadContext pCtx)
 
bool OnInputUserDataProcess (int userDataType, ParamsReadContext ctx)
 
bool StartAction (int action, Magazine mag, InventoryLocation il, ActionBase control_action=NULL)
 
void StartPendingAction ()
 
bool IsRunning ()
 
void SetRunning (bool value)
 
void Refresh ()
 
void Update (float deltaT)
 
void OnWeaponActionEnd ()
 
void DelayedRefreshAnimationState (int delay)
 
void RefreshAnimationState ()
 
bool WantContinue ()
 
Magazine GetPreparedMagazine ()
 
Magazine GetNextPreparedMagazine (out int startIdx)
 
void OnMagazineInventoryEnter (Magazine mag)
 
void OnMagazineInventoryExit (Magazine mag)
 
void OnMagazineAttach (Magazine mag)
 
void OnMagazineDetach (Magazine mag)
 
int CompareMagazinesSuitability (Magazine mag1, Magazine mag2)
 
void SortMagazineAfterLoad ()
 
void SetSutableMagazines ()
 
void OnLiftWeapon ()
 
string GetCurrentModeName ()
 
bool PrepareInventoryLocationForMagazineSwap (notnull Weapon_Base wpn, notnull Magazine new_mag, out InventoryLocation new_il)
 

Private Attributes

const float MAX_DROP_MAGAZINE_DISTANCE_SQ = 4
 

Detailed Description

Definition at line 1 of file WeaponManager.c.

Constructor & Destructor Documentation

◆ WeaponManager()

void WeaponManager::WeaponManager ( PlayerBase player)
inlineprotected

Definition at line 45 of file WeaponManager.c.

46 {
57 m_InProgress = false;
58 m_WantContinue = true;
59 m_IsEventSended = false;
60 m_canEnd = false;
61 m_readyToStart = false;
63
64 m_NewJamChance = -1;
66
71
72#ifdef DEVELOPER
73 m_BurstOption = 0;
74#endif
75 }
PlayerBase m_player
ActionBase m_ControlAction
int m_PendingWeaponActionAcknowledgmentID
ref array< Magazine > m_MagazinePilesInInventory
int m_ForceEjectBulletTimestamp
Magazine m_PendingTargetMagazine
int m_LastAcknowledgmentID
bool m_WaitToSyncJamChance
ref array< Magazine > m_SuitableMagazines
Weapon_Base m_WeaponInHand
ref array< MagazineStorage > m_MagazineStorageInInventory
Magazine m_PreparedMagazine
ref InventoryLocation m_PendingInventoryLocation
int m_PendingWeaponAction
MagazineStorage m_MagazineInHand
int m_AnimationRefreshCooldown

References m_AnimationRefreshCooldown, m_canEnd, m_ControlAction, m_ForceEjectBulletTimestamp, m_InProgress, m_IsEventSended, m_LastAcknowledgmentID, m_MagazineInHand, m_MagazinePilesInInventory, m_MagazineStorageInInventory, m_NewJamChance, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_PendingWeaponActionAcknowledgmentID, m_player, m_PreparedMagazine, m_readyToStart, m_SuitableMagazines, m_WaitToSyncJamChance, m_WantContinue, and m_WeaponInHand.

Member Function Documentation

◆ AttachMagazine()

bool WeaponManager::AttachMagazine ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 331 of file WeaponManager.c.

332 {
334 }
const int AT_WPN_ATTACH_MAGAZINE
Definition _constants.c:10
bool StartAction(int action, Magazine mag, InventoryLocation il, ActionBase control_action=NULL)

References AT_WPN_ATTACH_MAGAZINE, and StartAction().

Referenced by HandsContainer::OnPerformCombination().

◆ CanAttachMagazine()

bool WeaponManager::CanAttachMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 92 of file WeaponManager.c.

93 {
94 if (!wpn || !mag)
95 return false;
96
97 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
98 return false;
99
100 if (wpn.IsDamageDestroyed())
101 return false;
102
103 //if ( mag.GetHierarchyRootPlayer() && mag.GetHierarchyRootPlayer() != m_player )
104 //return false;
105
106 if (m_player.IsItemsToDelete())
107 return false;
108
109 if (reservationCheck && (m_player.GetInventory().HasInventoryReservation(wpn, null) || m_player.GetInventory().HasInventoryReservation(mag, null)))
110 return false;
111
114
115 mag.GetInventory().GetCurrentInventoryLocation(invLoc);
117
118
119 //magazine is already in weapon
120 if (Class.CastTo(wnp2, invLoc.GetParent()))
121 return false;
122
123 int muzzleIndex = wpn.GetCurrentMuzzle();
124
125 if (wpn.CanAttachMagazine(muzzleIndex, mag))
126 return true;
127
128 return false;
129
130 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
InventoryLocation.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), and m_player.

Referenced by HandsContainer::OnPerformCombination().

◆ CanDetachMagazine()

bool WeaponManager::CanDetachMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 181 of file WeaponManager.c.

182 {
183 if (!wpn || !mag)
184 return false;
185
186 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
187 return false;
188
189 if (mag.GetHierarchyParent() != wpn)
190 return false;
191
192 if (m_player.IsItemsToDelete())
193 return false;
194
195 if (reservationCheck && (m_player.GetInventory().HasInventoryReservation(wpn, null) || m_player.GetInventory().HasInventoryReservation(mag, null)))
196 return false;
197
198 return true;
199 }

References m_player.

◆ CanEjectBullet()

bool WeaponManager::CanEjectBullet ( Weapon_Base wpn,
bool reservationCheck = true )
inlineprotected

Definition at line 254 of file WeaponManager.c.

255 {
256 if (!wpn)
257 return false;
258
259 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
260 return false;
261
262 if (m_player.IsItemsToDelete())
263 return false;
264
265 if (reservationCheck && m_player.GetInventory().HasInventoryReservation(wpn, null))
266 return false;
267
268 if (!wpn.CanEjectBullet())
269 return false;
270
271 if (wpn.IsJammed(/*wpn.GetCurrentMuzzle()*/))
272 return false;
273
274 return true;
275 }

References m_player.

◆ CanEjectBulletVerified()

bool WeaponManager::CanEjectBulletVerified ( )
inlineprotected

Definition at line 379 of file WeaponManager.c.

380 {
381 int mi = m_WeaponInHand.GetCurrentMuzzle();
382 if (!m_WeaponInHand.IsChamberFiredOut(mi) && !m_WeaponInHand.IsChamberEmpty(mi))
383 {
384 int actual_time = GetGame().GetTime();
386 return false;
387 }
388 return true;
389 }
const int FORCE_EJECT_BULLET_TIMEOUT
proto native CGame GetGame()

References FORCE_EJECT_BULLET_TIMEOUT, GetGame(), m_ForceEjectBulletTimestamp, and m_WeaponInHand.

◆ CanFire()

bool WeaponManager::CanFire ( Weapon_Base wpn)
inlineprotected

Definition at line 79 of file WeaponManager.c.

80 {
81 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
82 return false;
83
84 if (m_player.IsLiftWeapon() || !m_player.IsRaised() || wpn.IsDamageDestroyed() || m_player.GetDayZPlayerInventory().IsProcessing() || !m_player.IsWeaponRaiseCompleted() || m_player.IsFighting())
85 return false;
86
87 return true;
88
89 }

References m_player.

◆ CanLoadBullet()

bool WeaponManager::CanLoadBullet ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 201 of file WeaponManager.c.

202 {
203 if (!wpn || !mag)
204 return false;
205
206 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
207 return false;
208
209 if (mag.IsDamageDestroyed() || wpn.IsDamageDestroyed())
210 return false;
211
212 if (wpn.IsJammed())
213 return false;
214
215 if (m_player.IsItemsToDelete())
216 return false;
217
218 if (reservationCheck && (m_player.GetInventory().HasInventoryReservation(wpn, null) || m_player.GetInventory().HasInventoryReservation(mag, null)))
219 return false;
220
221 for (int i = 0; i < wpn.GetMuzzleCount(); i++)
222 {
223 if (wpn.CanChamberBullet(i, mag))
224 return true;
225 }
226
227 return false;
228 }

References m_player.

◆ CanSwapMagazine()

bool WeaponManager::CanSwapMagazine ( Weapon_Base wpn,
Magazine mag,
bool reservationCheck = true )
inlineprotected

Definition at line 133 of file WeaponManager.c.

134 {
135 if (!wpn || !mag)
136 return false;
137
138 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
139 return false;
140
141 if (mag.IsDamageDestroyed() || wpn.IsDamageDestroyed())
142 return false;
143
144 //if ( mag.GetHierarchyRootPlayer() && mag.GetHierarchyRootPlayer() != m_player )
145 //return false;
146
147 if (m_player.IsItemsToDelete())
148 return false;
149
150 if (reservationCheck && (m_player.GetInventory().HasInventoryReservation(wpn, null) || m_player.GetInventory().HasInventoryReservation(mag, null)))
151 return false;
152
153
156
157 mag.GetInventory().GetCurrentInventoryLocation(invLoc);
159
160 //second magazine is already in weapon
161 if (Class.CastTo(wnp2, invLoc.GetParent()))
162 return false;
163
164 int muzzleIndex = wpn.GetCurrentMuzzle();
165
167 if (!Class.CastTo(mag2, wpn.GetMagazine(muzzleIndex)))
168 return false;
169
171 return true;
172
174
176 return true;
177
178 return false;
179 }
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:610
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:645

References GameInventory::CanForceSwapEntitiesEx(), GameInventory::CanSwapEntitiesEx(), Class::CastTo(), and m_player.

Referenced by HandsContainer::GetCombinationFlags(), and HandsContainer::OnPerformCombination().

◆ CanUnjam()

bool WeaponManager::CanUnjam ( Weapon_Base wpn,
bool reservationCheck = true )
inlineprotected

Definition at line 230 of file WeaponManager.c.

231 {
232 if (!wpn)
233 return false;
234
235 if (m_player.GetHumanInventory().GetEntityInHands() != wpn)
236 return false;
237
238 if (wpn.IsDamageDestroyed())
239 return false;
240
241 if (m_player.IsItemsToDelete())
242 return false;
243
244 if (reservationCheck && m_player.GetInventory().HasInventoryReservation(wpn, null))
245 return false;
246
247
248 if (!wpn.IsJammed(/*wpn.GetCurrentMuzzle()*/))
249 return false;
250
251 return true;
252 }

References m_player.

◆ CompareMagazinesSuitability()

int WeaponManager::CompareMagazinesSuitability ( Magazine mag1,
Magazine mag2 )
inlineprivate

Definition at line 1082 of file WeaponManager.c.

1083 {
1084 return mag1.GetAmmoCount() - mag2.GetAmmoCount();
1085 }

Referenced by OnMagazineInventoryEnter().

◆ DelayedRefreshAnimationState()

void WeaponManager::DelayedRefreshAnimationState ( int delay)
inlineprivate

Definition at line 941 of file WeaponManager.c.

942 {
943 if (m_WeaponInHand)
944 {
945 if (delay == 0)
948 }
949 }
void RefreshAnimationState()

References m_AnimationRefreshCooldown, m_WeaponInHand, and RefreshAnimationState().

◆ DetachMagazine()

bool WeaponManager::DetachMagazine ( InventoryLocation invLoc,
ActionBase control_action = NULL )
inlineprotected

Definition at line 336 of file WeaponManager.c.

337 {
339 }
const int AT_WPN_DETACH_MAGAZINE
Definition _constants.c:12

References AT_WPN_DETACH_MAGAZINE, and StartAction().

◆ EjectBullet()

bool WeaponManager::EjectBullet ( ActionBase control_action = NULL)
inlineprotected

Definition at line 374 of file WeaponManager.c.

375 {
377 }
const int AT_WPN_EJECT_BULLET
Definition _constants.c:15

References AT_WPN_EJECT_BULLET, and StartAction().

◆ EjectBulletVerified()

bool WeaponManager::EjectBulletVerified ( ActionBase control_action = NULL)
inlineprotected

Definition at line 391 of file WeaponManager.c.

392 {
393 if (m_WeaponInHand)
394 {
395 int mi = m_WeaponInHand.GetCurrentMuzzle();
396 if (!m_WeaponInHand.IsChamberFiredOut(mi) && !m_WeaponInHand.IsChamberEmpty(mi))
397 {
400 }
401 else
403 }
404 return false;
405 }

References AT_WPN_EJECT_BULLET, GetGame(), m_ForceEjectBulletTimestamp, m_WeaponInHand, and StartAction().

◆ Fire()

void WeaponManager::Fire ( Weapon_Base wpn)
inlineprotected

Definition at line 412 of file WeaponManager.c.

413 {
414 int mi = wpn.GetCurrentMuzzle();
415 if (wpn.IsChamberFiredOut(mi) || wpn.IsJammed() || wpn.IsChamberEmpty(mi))
416 {
417 wpn.ProcessWeaponEvent(new WeaponEventTrigger(m_player));
418 return;
419 }
420
421 if (wpn.JamCheck(0))
422 wpn.ProcessWeaponEvent(new WeaponEventTriggerToJam(m_player));
423 else
424 wpn.ProcessWeaponEvent(new WeaponEventTrigger(m_player));
425 }

References m_player.

◆ GetCurrentModeName()

string WeaponManager::GetCurrentModeName ( )
inlineprivate

Definition at line 1205 of file WeaponManager.c.

1206 {
1207 if (m_WeaponInHand)
1208 {
1209 int mi = m_WeaponInHand.GetCurrentMuzzle();
1210 return m_WeaponInHand.GetCurrentModeName(mi);
1211 }
1212 return "";
1213 }

References m_WeaponInHand.

Referenced by ScriptedWidgetEventHandler::SetWeaponModeAndZeroing().

◆ GetNextPreparedMagazine()

Magazine WeaponManager::GetNextPreparedMagazine ( out int startIdx)
inlineprivate

Definition at line 988 of file WeaponManager.c.

989 {
990 for (int i = startIdx; i < m_SuitableMagazines.Count(); i++)
991 {
992 if (m_SuitableMagazines.Get(i).GetAmmoCount() > 0)
993 {
994 startIdx = i;
995 return m_SuitableMagazines.Get(i);
996 }
997 }
998 return null;
999 }

References m_SuitableMagazines.

◆ GetPreparedMagazine()

Magazine WeaponManager::GetPreparedMagazine ( )
inlineprivate

Definition at line 971 of file WeaponManager.c.

972 {
973 for (int i = 0; i < m_SuitableMagazines.Count(); i++)
974 {
975 if (!m_SuitableMagazines.Get(i) || m_SuitableMagazines.Get(i).IsRuined())
976 {
977 m_SuitableMagazines.Remove(i);
978 i--;
979 continue;
980 }
981 if (m_SuitableMagazines.Get(i).GetAmmoCount() > 0)
982 return m_SuitableMagazines.Get(i);
983 }
984
985 return null;
986 }

References m_SuitableMagazines.

◆ InventoryReservation()

bool WeaponManager::InventoryReservation ( Magazine mag,
InventoryLocation invLoc )
inlineprotected

Definition at line 282 of file WeaponManager.c.

283 {
286 if (Weapon_Base.CastTo(weapon, m_player.GetItemInHands()))
287 {
288 weapon.GetInventory().GetCurrentInventoryLocation(ilWeapon);
289 if (m_player.GetInventory().HasInventoryReservation(weapon, ilWeapon))
290 return false;
291 else
292 m_player.GetInventory().AddInventoryReservationEx(weapon, ilWeapon, GameInventory.c_InventoryReservationTimeoutMS);
293 }
294
295 if (invLoc)
296 {
297 if (m_player.GetInventory().HasInventoryReservation(invLoc.GetItem(), invLoc))
298 {
299 m_player.GetInventory().ClearInventoryReservationEx(weapon, ilWeapon);
300 return false;
301 }
302 else
303 m_player.GetInventory().AddInventoryReservationEx(invLoc.GetItem(), invLoc, GameInventory.c_InventoryReservationTimeoutMS);
304 }
305
306 if (mag)
307 {
310
311 if (m_player.GetInventory().HasInventoryReservation(mag, m_TargetInventoryLocation))
312 //if ( !m_player.GetInventory().AddInventoryReservationEx( mag, m_TargetInventoryLocation, GameInventory.c_InventoryReservationTimeoutMS) )
313 {
314 m_player.GetInventory().ClearInventoryReservationEx(weapon, ilWeapon);
315 if (invLoc)
316 m_player.GetInventory().ClearInventoryReservationEx(invLoc.GetItem(), invLoc);
317 return false;
318 }
319 else
320 m_player.GetInventory().AddInventoryReservationEx(mag, m_TargetInventoryLocation, GameInventory.c_InventoryReservationTimeoutMS);
321 }
324
325 return true;
326 }
const int c_InventoryReservationTimeoutMS
reservations
Definition Inventory.c:687
provides access to slot configuration
ref InventoryLocation m_TargetInventoryLocation

References GameInventory::c_InventoryReservationTimeoutMS, m_PendingInventoryLocation, m_PendingTargetMagazine, m_player, m_TargetInventoryLocation, and m_WeaponInHand.

Referenced by StartAction().

◆ IsRunning()

bool WeaponManager::IsRunning ( )
inlineprivate

Definition at line 787 of file WeaponManager.c.

788 {
789 return m_InProgress;
790 }

References m_InProgress.

Referenced by ActionPossibilityCheck(), and CanPlayEmote().

◆ LoadBullet()

bool WeaponManager::LoadBullet ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 354 of file WeaponManager.c.

355 {
357 }
const int AT_WPN_LOAD_BULLET
Definition _constants.c:13

References AT_WPN_LOAD_BULLET, and StartAction().

Referenced by HandsContainer::OnPerformCombination().

◆ LoadMultiBullet()

bool WeaponManager::LoadMultiBullet ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 359 of file WeaponManager.c.

360 {
362 }
const int AT_WPN_LOAD_MULTI_BULLETS_START
Definition _constants.c:16

References AT_WPN_LOAD_MULTI_BULLETS_START, and StartAction().

◆ LoadMultiBulletStop()

void WeaponManager::LoadMultiBulletStop ( )
inlineprotected

Definition at line 364 of file WeaponManager.c.

365 {
366 if (m_InProgress) m_WantContinue = false;
367 }

References m_InProgress, and m_WantContinue.

◆ OnInputUserDataProcess()

bool WeaponManager::OnInputUserDataProcess ( int userDataType,
ParamsReadContext ctx )
inlineprivate

Definition at line 543 of file WeaponManager.c.

544 {
546 int mi;
548 int slotID;
549 bool accepted = false;
551 {
552 if (!ctx.Read(m_PendingWeaponAction))
553 return false;
554
556 return false;
557
559 {
560 GetGame().ClearJuncture(m_player, m_PendingTargetMagazine);
562 }
563 m_InProgress = true;
564 m_IsEventSended = false;
565 Magazine mag = NULL;
566
567 Weapon_Base.CastTo(wpn, m_player.GetItemInHands());
568 if (wpn)
569 mi = wpn.GetCurrentMuzzle();
570
571 switch (m_PendingWeaponAction)
572 {
574 {
575 if (!ctx.Read(mag))
576 break;
577
578 if (!mag || !wpn)
579 break;
580
581 slotID = wpn.GetSlotFromMuzzleIndex(mi);
582 il = new InventoryLocation();
583 il.SetAttachment(wpn, mag, slotID);
584 if (GetGame().AddInventoryJunctureEx(m_player, mag, il, false, 10000))
585 accepted = true;
586
588 break;
589 }
591 {
592 if (!ctx.Read(mag))
593 break;
594
595 il = new InventoryLocation();
596 if (!il.ReadFromContext(ctx))
597 break;
598
599 if (!mag || !wpn)
600 break;
601
602 if (!wpn.GetMagazine(mi))
603 break;
604
605 if (GetGame().AddActionJuncture(m_player, mag, 10000))
606 accepted = true;
609
610 break;
611 }
613 {
614 il = new InventoryLocation();
615 if (!il.ReadFromContext(ctx))
616 break;
617
618 if (!il.IsValid())
619 break;
620
621 if (!wpn)
622 break;
623
624 Magazine det_mag = wpn.GetMagazine(mi);
625 mag = Magazine.Cast(il.GetItem());
626 if (!det_mag || (mag != det_mag))
627 break;
628
629 if (GetGame().AddInventoryJunctureEx(m_player, il.GetItem(), il, true, 10000))
630 accepted = true;
633 break;
634 }
636 {
637 ctx.Read(mag);
638
639 if (!mag)
640 break;
641
642 if (GetGame().AddActionJuncture(m_player, mag, 10000))
643 accepted = true;
645 break;
646 }
648 {
649 ctx.Read(mag);
650
651 if (!mag)
652 break;
653
654 if (GetGame().AddActionJuncture(m_player, mag, 10000))
655 accepted = true;
657 break;
658 }
659 case AT_WPN_UNJAM:
660 {
661 accepted = true;
662 //Unjam();
663 break;
664 }
666 {
667 accepted = true;
668 break;
669 }
671 {
672 accepted = true;
673 break;
674 }
675 default:
676 Error("unknown actionID=" + m_PendingWeaponAction);
677 break;
678 }
680 }
681
682 return accepted;
683 }
const int INPUT_UDT_WEAPON_ACTION
Definition _constants.c:7
const int AT_WPN_UNJAM
Definition _constants.c:14
const int AT_WPN_SWAP_MAGAZINE
Definition _constants.c:11
const int AT_WPN_SET_NEXT_MUZZLE_MODE
Definition _constants.c:18
static void SendWeaponActionAcknowledgment(DayZPlayer pPlayer, int AckID, bool accept)
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References AT_WPN_ATTACH_MAGAZINE, AT_WPN_DETACH_MAGAZINE, AT_WPN_EJECT_BULLET, AT_WPN_LOAD_BULLET, AT_WPN_LOAD_MULTI_BULLETS_START, AT_WPN_SET_NEXT_MUZZLE_MODE, AT_WPN_SWAP_MAGAZINE, AT_WPN_UNJAM, Error(), GetGame(), INPUT_UDT_WEAPON_ACTION, m_InProgress, m_IsEventSended, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_PendingWeaponActionAcknowledgmentID, m_player, and DayZPlayerSyncJunctures::SendWeaponActionAcknowledgment().

◆ OnLiftWeapon()

void WeaponManager::OnLiftWeapon ( )
inlineprivate

Definition at line 1199 of file WeaponManager.c.

1200 {
1201 if (m_WeaponInHand)
1202 m_WeaponInHand.ResetBurstCount();
1203 }

References m_WeaponInHand.

◆ OnMagazineAttach()

void WeaponManager::OnMagazineAttach ( Magazine mag)
inlineprivate

Definition at line 1072 of file WeaponManager.c.

1073 {
1075 }
void OnMagazineInventoryExit(Magazine mag)

References OnMagazineInventoryExit().

◆ OnMagazineDetach()

void WeaponManager::OnMagazineDetach ( Magazine mag)
inlineprivate

Definition at line 1077 of file WeaponManager.c.

1078 {
1080 }
void OnMagazineInventoryEnter(Magazine mag)

References OnMagazineInventoryEnter().

◆ OnMagazineInventoryEnter()

void WeaponManager::OnMagazineInventoryEnter ( Magazine mag)
inlineprivate

Definition at line 1001 of file WeaponManager.c.

1002 {
1003 if (mag)
1004 {
1005 Weapon_Base weapon = Weapon_Base.Cast(mag.GetHierarchyParent());
1006
1007 if (weapon)
1008 return;
1009 }
1010
1011 int i;
1012 MagazineStorage sMag = MagazineStorage.Cast(mag);
1013 if (sMag)
1014 {
1015 for (i = 0; i < m_MagazineStorageInInventory.Count(); i++)
1016 {
1017 MagazineStorage s_mag_i = m_MagazineStorageInInventory[i];
1018 if (!s_mag_i)
1019 {
1020 m_MagazineStorageInInventory.RemoveOrdered(i);
1021 i--;
1022 continue;
1023 }
1024
1026 break;
1027 }
1029
1030 SetSutableMagazines(); //TODO optimalize
1031 return;
1032 }
1033
1034 if (mag)
1035 {
1036
1037 for (i = 0; i < m_MagazinePilesInInventory.Count(); i++)
1038 {
1040 if (!mag_i)
1041 {
1042 m_MagazinePilesInInventory.RemoveOrdered(i);
1043 i--;
1044 continue;
1045 }
1046
1047
1049 break;
1050 }
1051 m_MagazinePilesInInventory.InsertAt(mag, i);
1052 SetSutableMagazines(); //TODO optimalize
1053 }
1054
1055 }
void SetSutableMagazines()
int CompareMagazinesSuitability(Magazine mag1, Magazine mag2)

References CompareMagazinesSuitability(), m_MagazinePilesInInventory, m_MagazineStorageInInventory, and SetSutableMagazines().

Referenced by OnMagazineDetach().

◆ OnMagazineInventoryExit()

void WeaponManager::OnMagazineInventoryExit ( Magazine mag)
inlineprivate

Definition at line 1057 of file WeaponManager.c.

1058 {
1059 m_SuitableMagazines.RemoveItem(mag);
1060
1061 MagazineStorage sMag = MagazineStorage.Cast(mag);
1062 if (sMag)
1063 {
1065 return;
1066 }
1067
1068 if (mag)
1069 m_MagazinePilesInInventory.RemoveItem(mag);
1070 }

References m_MagazinePilesInInventory, m_MagazineStorageInInventory, and m_SuitableMagazines.

Referenced by OnMagazineAttach().

◆ OnSyncJuncture()

void WeaponManager::OnSyncJuncture ( int pJunctureID,
ParamsReadContext pCtx )
inlineprivate

Definition at line 501 of file WeaponManager.c.

502 {
504 pCtx.Read(m_NewJamChance);
505 else
506 {
510 {
512 m_readyToStart = true;
514 {
515 if (m_PendingWeaponAction >= 0)
516 {
517 if (!(GetGame().IsServer() && GetGame().IsMultiplayer()))
518 {
520 ItemBase weapon = m_player.GetItemInHands();
521 weapon.GetInventory().GetCurrentInventoryLocation(ilWeapon);
522 m_player.GetInventory().ClearInventoryReservationEx(m_player.GetItemInHands(), ilWeapon);
523
525 m_PendingTargetMagazine.GetInventory().ClearInventoryReservationEx(m_PendingTargetMagazine, m_TargetInventoryLocation);
526
528 m_player.GetInventory().ClearInventoryReservationEx(NULL, m_PendingInventoryLocation);
529 }
534 m_InProgress = false;
535 }
536 }
537 }
538 }
539 }
static const int SJ_WEAPON_ACTION_ACK_REJECT
static const int SJ_WEAPON_ACTION_ACK_ACCEPT
static const int SJ_WEAPON_SET_JAMMING_CHANCE

References GetGame(), m_InProgress, m_NewJamChance, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_PendingWeaponActionAcknowledgmentID, m_player, m_readyToStart, m_TargetInventoryLocation, DayZPlayerSyncJunctures::SJ_WEAPON_ACTION_ACK_ACCEPT, DayZPlayerSyncJunctures::SJ_WEAPON_ACTION_ACK_REJECT, and DayZPlayerSyncJunctures::SJ_WEAPON_SET_JAMMING_CHANCE.

◆ OnWeaponActionEnd()

void WeaponManager::OnWeaponActionEnd ( )
inlineprivate

Definition at line 902 of file WeaponManager.c.

903 {
904 if (!m_InProgress)
905 return;
906
907 if (!m_ControlAction)
908 {
909 if (GetGame().IsServer() && GetGame().IsMultiplayer())
910 {
912 GetGame().ClearJuncture(m_player, m_PendingTargetMagazine);
913 }
914 else
915 {
917 il.SetHands(m_player, m_player.GetItemInHands());
918 m_player.GetInventory().ClearInventoryReservationEx(m_player.GetItemInHands(), il);
919
921 m_player.GetInventory().ClearInventoryReservationEx(m_PendingTargetMagazine, m_TargetInventoryLocation);
922
924 m_player.GetInventory().ClearInventoryReservationEx(m_PendingInventoryLocation.GetItem(), m_PendingInventoryLocation);
925 }
926 }
927
934 //m_WeaponInHand = NULL;
935 m_InProgress = false;
936 m_readyToStart = false;
937 m_WantContinue = true;
938
939 }

References GetGame(), m_ControlAction, m_InProgress, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_PendingWeaponActionAcknowledgmentID, m_player, m_readyToStart, m_TargetInventoryLocation, and m_WantContinue.

Referenced by Refresh(), StartPendingAction(), and Update().

◆ PrepareInventoryLocationForMagazineSwap()

bool WeaponManager::PrepareInventoryLocationForMagazineSwap ( notnull Weapon_Base wpn,
notnull Magazine new_mag,
out InventoryLocation new_il )
inlineprivate

Definition at line 1215 of file WeaponManager.c.

1216 {
1217 int muzzleIndex = wpn.GetCurrentMuzzle();
1218 Magazine old_mag = Magazine.Cast(wpn.GetMagazine(muzzleIndex));
1220
1221 if (old_mag)
1222 {
1224 if (result)
1225 {
1226 new_mag.GetInventory().GetCurrentInventoryLocation(new_il);
1227 new_il.SetItem(old_mag);
1228 }
1229 else
1230 {
1232 float dir[4];
1233 if (!result)
1234 new_il.SetGroundEx(old_mag, m_player.GetPosition(), dir);
1235 }
1236 }
1237 return true;
1238 }

References GameInventory::CanForceSwapEntitiesEx(), GameInventory::CanSwapEntitiesEx(), and m_player.

Referenced by SwapMagazine().

◆ Refresh()

void WeaponManager::Refresh ( )
inlineprivate

Definition at line 797 of file WeaponManager.c.

798 {
800 }
void OnWeaponActionEnd()

References OnWeaponActionEnd().

◆ RefreshAnimationState()

void WeaponManager::RefreshAnimationState ( )
inlineprivate

Definition at line 951 of file WeaponManager.c.

952 {
953 if (m_WeaponInHand)
954 {
956
957 if (state)
958 {
959 HumanCommandWeapons hcw = m_player.GetCommandModifier_Weapons();
960 if (hcw)
961 hcw.SetInitState(state.m_animState);
962 }
963 }
964 }
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
Definition Crossbow.c:27

References m_player, and m_WeaponInHand.

Referenced by DelayedRefreshAnimationState(), and Update().

◆ SetEjectBulletTryTimestamp()

void WeaponManager::SetEjectBulletTryTimestamp ( )
inlineprotected

Definition at line 277 of file WeaponManager.c.

278 {
280 }

References GetGame(), and m_ForceEjectBulletTimestamp.

◆ SetNextMuzzleMode()

bool WeaponManager::SetNextMuzzleMode ( )
inlineprotected

Definition at line 407 of file WeaponManager.c.

408 {
410 }

References AT_WPN_SET_NEXT_MUZZLE_MODE, and StartAction().

◆ SetRunning()

void WeaponManager::SetRunning ( bool value)
inlineprivate

Definition at line 792 of file WeaponManager.c.

793 {
795 }

References m_InProgress.

◆ SetSutableMagazines()

void WeaponManager::SetSutableMagazines ( )
inlineprivate

Definition at line 1140 of file WeaponManager.c.

1141 {
1142 m_SuitableMagazines.Clear();
1143 int i;
1144
1145 if (m_WeaponInHand)
1146 {
1147 int mi = m_WeaponInHand.GetCurrentMuzzle();
1148
1149 for (i = 0; i < m_MagazineStorageInInventory.Count(); i++)
1150 {
1151 MagazineStorage s_mag = m_MagazineStorageInInventory[i];
1152
1153 if (!s_mag)
1154 {
1155 m_MagazineStorageInInventory.RemoveOrdered(i);
1156 i--;
1157 continue;
1158 }
1159
1160 if (m_WeaponInHand.TestAttachMagazine(mi, s_mag, false, true))
1161 m_SuitableMagazines.Insert(s_mag);
1162 }
1163
1164 for (i = 0; i < m_MagazinePilesInInventory.Count(); i++)
1165 {
1167 if (!mag)
1168 {
1169 m_MagazinePilesInInventory.RemoveOrdered(i);
1170 i--;
1171 continue;
1172 }
1173
1174 if (m_WeaponInHand.CanChamberFromMag(mi, mag))
1175 m_SuitableMagazines.Insert(mag);
1176 }
1177 //TODO m_MagazineStorageInInventory and m_MagazinePilesInInventory always sort
1178 }
1179 else if (m_MagazineInHand)
1180 {
1181 for (i = 0; i < m_MagazinePilesInInventory.Count(); i++)
1182 {
1184 if (!m_mag)
1185 {
1186 m_MagazinePilesInInventory.RemoveOrdered(i);
1187 i--;
1188 continue;
1189 }
1190 if (m_MagazineInHand.IsCompatiableAmmo(m_mag))
1191 m_SuitableMagazines.Insert(m_mag);
1192 }
1193 }
1194 else
1196
1197 }

References m_MagazineInHand, m_MagazinePilesInInventory, m_MagazineStorageInInventory, m_PreparedMagazine, m_SuitableMagazines, and m_WeaponInHand.

Referenced by OnMagazineInventoryEnter(), SortMagazineAfterLoad(), and Update().

◆ SortMagazineAfterLoad()

void WeaponManager::SortMagazineAfterLoad ( )
inlineprivate

Definition at line 1087 of file WeaponManager.c.

1088 {
1091 int low_mag1, high_mag1;
1092 int low_mag2, high_mag2;
1093 int i, j;
1094
1095 for (i = 0; i < m_MagazineStorageInInventory.Count(); i++)
1096 {
1097 MagazineStorage mag = m_MagazineStorageInInventory.Get(i);
1098 mag.GetNetworkID(low_mag1, high_mag1);
1099 for (j = 0; j < magazines.Count(); j++)
1100 {
1101 magazines.Get(j).GetNetworkID(low_mag2, high_mag2);
1102 if (low_mag1 > low_mag2)
1103 break;
1104 else if (low_mag1 == low_mag2)
1105 {
1106 if (high_mag1 > high_mag2)
1107 break;
1108 }
1109 }
1110 magazines.InsertAt(mag, j);
1111 }
1112
1115
1116 for (i = 0; i < m_MagazinePilesInInventory.Count(); i++)
1117 {
1119 pile.GetNetworkID(low_mag1, high_mag1);
1120 for (j = 0; j < magazines_piles.Count(); j++)
1121 {
1122 magazines_piles.Get(j).GetNetworkID(low_mag2, high_mag2);
1123 if (low_mag1 > low_mag2)
1124 break;
1125 else if (low_mag1 == low_mag2)
1126 {
1127 if (high_mag1 > high_mag2)
1128 break;
1129 }
1130 }
1131 magazines_piles.InsertAt(pile, j);
1132 }
1133
1136
1138 }

References m_MagazinePilesInInventory, m_MagazineStorageInInventory, and SetSutableMagazines().

◆ StartAction()

bool WeaponManager::StartAction ( int action,
Magazine mag,
InventoryLocation il,
ActionBase control_action = NULL )
inlineprivate

Definition at line 685 of file WeaponManager.c.

686 {
687 //if it is controled by action inventory reservation and synchronization provide action itself
688 if (control_action)
689 {
690 m_ControlAction = ActionBase.Cast(control_action);
692 m_InProgress = true;
693 m_IsEventSended = false;
697
698 return true;
699 }
700
701
702 if (GetGame().IsMultiplayer() && GetGame().IsServer())
703 return false;
704
706 return false;
708 return false;
709
711 m_InProgress = true;
712 m_IsEventSended = false;
713
714 if (!GetGame().IsMultiplayer())
715 m_readyToStart = true;
716 else
717 Synchronize();
718
719 return true;
720 }
proto static native bool CanStoreInputUserData()
void StartPendingAction()
bool InventoryReservation(Magazine mag, InventoryLocation invLoc)

References ScriptInputUserData::CanStoreInputUserData(), GetGame(), InventoryReservation(), m_ControlAction, m_InProgress, m_IsEventSended, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_readyToStart, StartPendingAction(), and Synchronize().

Referenced by AttachMagazine(), DetachMagazine(), EjectBullet(), EjectBulletVerified(), LoadBullet(), LoadMultiBullet(), SetNextMuzzleMode(), SwapMagazine(), SwapMagazineEx(), and Unjam().

◆ StartPendingAction()

void WeaponManager::StartPendingAction ( )
inlineprivate

Definition at line 722 of file WeaponManager.c.

723 {
724 m_WeaponInHand = Weapon_Base.Cast(m_player.GetItemInHands());
725 if (!m_WeaponInHand)
726 {
728 return;
729 }
730 switch (m_PendingWeaponAction)
731 {
733 {
734 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventAttachMagazine(m_player, m_PendingTargetMagazine));
735 break;
736 }
738 {
739 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventSwapMagazine(m_player, m_PendingTargetMagazine, m_PendingInventoryLocation));
740 break;
741 }
743 {
745 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventDetachMagazine(m_player, mag, m_PendingInventoryLocation));
746 break;
747 }
749 {
750 m_WantContinue = false;
751 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventLoad1Bullet(m_player, m_PendingTargetMagazine));
752 break;
753 }
755 {
756 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventLoad1Bullet(m_player, m_PendingTargetMagazine));
757 break;
758 }
760 {
761 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventContinuousLoadBulletEnd(m_player));
762 break;
763 }
764 case AT_WPN_UNJAM:
765 {
766 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventUnjam(m_player, NULL));
767 break;
768 }
770 {
771 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventMechanism(m_player, NULL));
772 break;
773 }
775 {
776 m_player.GetDayZPlayerInventory().PostWeaponEvent(new WeaponEventSetNextMuzzleMode(m_player, NULL));
777 break;
778 }
779 default:
780 m_InProgress = false;
781 Error("unknown actionID=" + m_PendingWeaponAction);
782 }
783 m_IsEventSended = true;
784 m_canEnd = false;
785 }
const int AT_WPN_LOAD_MULTI_BULLETS_END
Definition _constants.c:17

References AT_WPN_ATTACH_MAGAZINE, AT_WPN_DETACH_MAGAZINE, AT_WPN_EJECT_BULLET, AT_WPN_LOAD_BULLET, AT_WPN_LOAD_MULTI_BULLETS_END, AT_WPN_LOAD_MULTI_BULLETS_START, AT_WPN_SET_NEXT_MUZZLE_MODE, AT_WPN_SWAP_MAGAZINE, AT_WPN_UNJAM, Error(), m_canEnd, m_InProgress, m_IsEventSended, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, m_player, m_WantContinue, m_WeaponInHand, and OnWeaponActionEnd().

Referenced by StartAction(), and Update().

◆ SwapMagazine()

bool WeaponManager::SwapMagazine ( Magazine mag,
ActionBase control_action = NULL )
inlineprotected

Definition at line 341 of file WeaponManager.c.

342 {
346 return false;
347 }
bool PrepareInventoryLocationForMagazineSwap(notnull Weapon_Base wpn, notnull Magazine new_mag, out InventoryLocation new_il)

References AT_WPN_SWAP_MAGAZINE, m_WeaponInHand, PrepareInventoryLocationForMagazineSwap(), and StartAction().

Referenced by HandsContainer::OnPerformCombination().

◆ SwapMagazineEx()

bool WeaponManager::SwapMagazineEx ( Magazine mag,
InventoryLocation invLoc,
ActionBase control_action = NULL )
inlineprotected

Definition at line 349 of file WeaponManager.c.

References AT_WPN_SWAP_MAGAZINE, and StartAction().

◆ Synchronize()

void WeaponManager::Synchronize ( )
inlineprivate

Definition at line 443 of file WeaponManager.c.

444 {
445 if (GetGame().IsClient())
446 {
449
453
454
455 switch (m_PendingWeaponAction)
456 {
458 {
460 break;
461 }
463 {
465 m_PendingInventoryLocation.WriteToContext(ctx);
466 break;
467 }
469 {
470 m_PendingInventoryLocation.WriteToContext(ctx);
471 break;
472 }
474 {
476 break;
477 }
479 {
481 break;
482 }
483 case AT_WPN_UNJAM:
484 {
485 break;
486 }
488 {
489 break;
490 }
491 default:
492 break;
493 }
494 ctx.Send();
495 //if( !m_player.GetDayZPlayerInventory().HasLockedHands() )
496 // m_player.GetDayZPlayerInventory().LockHands();
497 }
498 }

References AT_WPN_ATTACH_MAGAZINE, AT_WPN_DETACH_MAGAZINE, AT_WPN_EJECT_BULLET, AT_WPN_LOAD_BULLET, AT_WPN_LOAD_MULTI_BULLETS_START, AT_WPN_SWAP_MAGAZINE, AT_WPN_UNJAM, GetGame(), INPUT_UDT_WEAPON_ACTION, m_LastAcknowledgmentID, m_PendingInventoryLocation, m_PendingTargetMagazine, m_PendingWeaponAction, and m_PendingWeaponActionAcknowledgmentID.

Referenced by StartAction().

◆ Unjam()

bool WeaponManager::Unjam ( ActionBase control_action = NULL)
inlineprotected

Definition at line 369 of file WeaponManager.c.

370 {
372 }

References AT_WPN_UNJAM, and StartAction().

◆ Update()

void WeaponManager::Update ( float deltaT)
inlineprivate

Definition at line 802 of file WeaponManager.c.

803 {
804 if (m_WeaponInHand != m_player.GetItemInHands())
805 {
806 if (m_WeaponInHand)
807 {
808 m_SuitableMagazines.Clear();
810 }
811 m_WeaponInHand = Weapon_Base.Cast(m_player.GetItemInHands());
812 if (m_WeaponInHand)
813 {
815 //SET new magazine
817 m_WeaponInHand.SetSyncJammingChance(0);
818 }
820 }
821
822 if (m_WeaponInHand)
823 {
825 {
827
830 }
831
832 if (!GetGame().IsMultiplayer())
833 m_WeaponInHand.SetSyncJammingChance(m_WeaponInHand.GetChanceToJam());
834 else
835 {
836 if (m_NewJamChance >= 0)
837 {
838 m_WeaponInHand.SetSyncJammingChance(m_NewJamChance);
839 m_NewJamChance = -1;
840 m_WaitToSyncJamChance = false;
841 }
842 if (GetGame().IsServer() && !m_WaitToSyncJamChance)
843 {
846 if (Math.AbsFloat(m_WeaponInHand.GetSyncChanceToJam() - m_WeaponInHand.GetChanceToJam()) > 0.001)
847 {
850 }
851 }
852 }
853
854 if (m_readyToStart)
855 {
857 m_readyToStart = false;
858 return;
859 }
860
862 return;
863
864 if (m_canEnd)
865 {
866 if (m_WeaponInHand.IsIdle())
868 else if (m_justStart)
869 {
870 m_InIronSight = m_player.IsInIronsights();
871 m_InOptic = m_player.IsInOptics();
872
874 {
875 //'RequestResetADSSync' can be called here, if ADS reset is desired
876 m_player.ExitSights();
877 }
878
879 m_justStart = false;
880 }
881
882 }
883 else
884 {
885 m_canEnd = true;
886 m_justStart = true;
887 }
888 }
889 else
890 {
891 if (m_MagazineInHand != m_player.GetItemInHands())
892 {
893 m_MagazineInHand = MagazineStorage.Cast(m_player.GetItemInHands());
896 }
897
898
899 }
900 }
static void SendWeaponJamChance(DayZPlayer pPlayer, float jamChance)
Definition EnMath.c:7
override float GetChanceToJam()
static proto float AbsFloat(float f)
Returns absolute value.

References Math::AbsFloat(), Weapon_Base::GetChanceToJam(), GetGame(), m_AnimationRefreshCooldown, m_canEnd, m_InIronSight, m_InOptic, m_InProgress, m_IsEventSended, m_justStart, m_MagazineInHand, m_NewJamChance, m_player, m_readyToStart, m_SuitableMagazines, m_WaitToSyncJamChance, m_WeaponInHand, OnWeaponActionEnd(), RefreshAnimationState(), DayZPlayerSyncJunctures::SendWeaponJamChance(), SetSutableMagazines(), and StartPendingAction().

◆ WantContinue()

bool WeaponManager::WantContinue ( )
inlineprivate

Definition at line 966 of file WeaponManager.c.

967 {
968 return m_WantContinue;
969 }

References m_WantContinue.

Member Data Documentation

◆ FORCE_EJECT_BULLET_TIMEOUT

const int WeaponManager::FORCE_EJECT_BULLET_TIMEOUT = 2000
protected

Definition at line 28 of file WeaponManager.c.

Referenced by CanEjectBulletVerified().

◆ m_AnimationRefreshCooldown

int WeaponManager::m_AnimationRefreshCooldown
protected

Definition at line 43 of file WeaponManager.c.

Referenced by DelayedRefreshAnimationState(), Update(), and WeaponManager().

◆ m_canEnd

bool WeaponManager::m_canEnd
protected

Definition at line 15 of file WeaponManager.c.

Referenced by StartPendingAction(), Update(), and WeaponManager().

◆ m_ControlAction

ActionBase WeaponManager::m_ControlAction
protected

Definition at line 25 of file WeaponManager.c.

Referenced by OnWeaponActionEnd(), StartAction(), and WeaponManager().

◆ m_ForceEjectBulletTimestamp

int WeaponManager::m_ForceEjectBulletTimestamp
protected

◆ m_InIronSight

bool WeaponManager::m_InIronSight
protected

Definition at line 20 of file WeaponManager.c.

Referenced by Update().

◆ m_InOptic

bool WeaponManager::m_InOptic
protected

Definition at line 21 of file WeaponManager.c.

Referenced by Update().

◆ m_InProgress

◆ m_IsEventSended

bool WeaponManager::m_IsEventSended
protected

◆ m_justStart

bool WeaponManager::m_justStart
protected

Definition at line 16 of file WeaponManager.c.

Referenced by Update().

◆ m_LastAcknowledgmentID

int WeaponManager::m_LastAcknowledgmentID
protected

Definition at line 7 of file WeaponManager.c.

Referenced by Synchronize(), and WeaponManager().

◆ m_MagazineInHand

MagazineStorage WeaponManager::m_MagazineInHand
protected

Definition at line 24 of file WeaponManager.c.

Referenced by SetSutableMagazines(), Update(), and WeaponManager().

◆ m_MagazinePilesInInventory

ref array<Magazine> WeaponManager::m_MagazinePilesInInventory
protected

◆ m_MagazineStorageInInventory

ref array<MagazineStorage> WeaponManager::m_MagazineStorageInInventory
protected

◆ m_NewJamChance

float WeaponManager::m_NewJamChance
protected

Definition at line 39 of file WeaponManager.c.

Referenced by OnSyncJuncture(), Update(), and WeaponManager().

◆ m_PendingInventoryLocation

◆ m_PendingTargetMagazine

Magazine WeaponManager::m_PendingTargetMagazine
protected

◆ m_PendingWeaponAction

int WeaponManager::m_PendingWeaponAction
protected

◆ m_PendingWeaponActionAcknowledgmentID

int WeaponManager::m_PendingWeaponActionAcknowledgmentID
protected

◆ m_player

◆ m_PreparedMagazine

Magazine WeaponManager::m_PreparedMagazine
protected

Definition at line 36 of file WeaponManager.c.

Referenced by SetSutableMagazines(), and WeaponManager().

◆ m_readyToStart

bool WeaponManager::m_readyToStart
protected

Definition at line 22 of file WeaponManager.c.

Referenced by OnSyncJuncture(), OnWeaponActionEnd(), StartAction(), Update(), and WeaponManager().

◆ m_SuitableMagazines

ref array<Magazine> WeaponManager::m_SuitableMagazines
protected

◆ m_TargetInventoryLocation

ref InventoryLocation WeaponManager::m_TargetInventoryLocation
protected

Definition at line 11 of file WeaponManager.c.

Referenced by InventoryReservation(), OnSyncJuncture(), and OnWeaponActionEnd().

◆ m_WaitToSyncJamChance

bool WeaponManager::m_WaitToSyncJamChance
protected

Definition at line 40 of file WeaponManager.c.

Referenced by Update(), and WeaponManager().

◆ m_WantContinue

bool WeaponManager::m_WantContinue
protected

◆ m_WeaponInHand

◆ MAX_DROP_MAGAZINE_DISTANCE_SQ

const float WeaponManager::MAX_DROP_MAGAZINE_DISTANCE_SQ = 4
private

Definition at line 3 of file WeaponManager.c.

Referenced by WeaponStateBase::OnAbort(), OnAbort(), and WeaponStateBase::OnExit().


The documentation for this class was generated from the following file: