You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Cleaned up Attachable handling so all attachables sit in one list, added template function and unordered_set to clean up hardcoded attachable handling while still avoiding duplicates
Removed the m_DamageMultiplierRedefined flag and used -1 to define default instead
Fixed various method comments and other minor stuff
/// Attaches the passed in Attachable and adds it to the list of attachables, changing its parent offset to the passed in Vector but not treating it as hardcoded.
1637
-
/// </summary>
1638
-
/// <param name="pAttachable">The Attachable to add.</param>
1639
-
/// <param name="parentOffsetToSet">The vector to set as the Attachable's parent offset.</param>
/// Attaches the passed in Attachable and adds it to the list of attachables, not changing its parent offset but treating it as hardcoded depending on the passed in boolean.
1648
-
/// </summary>
1649
-
/// <param name="pAttachable">The Attachable to add.</param>
1650
-
/// <param name="isHardcodedAttachable">Whether or not the Attachable should be treated as hardcoded.</param>
/// Attaches the passed in Attachable and adds it to the list of attachables, changing its parent offset to the passed in Vector and treating it as hardcoded depending on the passed in boolean.
1662
-
/// </summary>
1663
-
/// <param name="pAttachable">The Attachable to add.</param>
1664
-
/// <param name="parentOffsetToSet">The vector to set as the Attachable's parent offset.</param>
1665
-
/// <param name="isHardcodedAttachable">Whether or not the Attachable should be treated as hardcoded.</param>
/// Attaches the passed in Attachable and adds it to the list of attachables, changing its parent offset to the passed in Vector but not treating it as hardcoded.
436
+
/// Adds the passed in Attachable the list of attachables, changes its parent offset to the passed in Vector, and sets its parent to this MOSRotating.
437
+
/// </summary>
438
+
/// <param name="attachable">The Attachable to add.</param>
439
+
/// <param name="parentOffsetToSet">The Vector to set as the Attachable's parent offset.</param>
/// Clones a hardcoded attachable, setting the appropriate member variable, and calling AddAttachable.
823
+
/// Also adds the reference attachable's UniqueID to the std::unordered_set of already copied attachable unique IDs so it doesn't get duplicated.
824
+
/// </summary>
825
+
/// <param name="referenceAttachable">The relevant hardcoded attachable belonging to the reference object being cloned.</param>
826
+
/// <param name="hardcodedAttachableSetter">A std::function containing the setter for the given hardcoded attachable. Aside from setting the relevant member variable, this setter should call AddAttachable.</param>
827
+
template<classT> voidCloneHardcodedAttachable(Attachable *referenceAttachable, T hardcodedAttachableSetter) {
// The vector that the recoil offsets the sprite when m_Recoiled is true.
871
891
Vector m_RecoilOffset;
872
-
// The list of wound AEmitters currently attached to this MOSRotating, and owned here as well
892
+
// The list of wound AEmitters currently attached to this MOSRotating, and owned here as well.
873
893
std::list<AEmitter *> m_Wounds;
874
-
// The list of general Attachables currently attached and Owned by this.
894
+
// The list of Attachables currently attached and Owned by this.
875
895
std::list<Attachable *> m_Attachables;
876
-
// The list of all Attachables, including both hardcoded attachables and those added through ini or lua
877
-
std::list<Attachable *> m_AllAttachables;
896
+
std::unordered_set<unsignedlong> m_AlreadyCopiedAttachableUniqueIDs; //<! An unordered set of Unique IDs, used to avoid duplicating hardcoded attachables (i.e. head, legs, etc.) when cloning.
878
897
// The list of Gib:s this will create when gibbed
879
898
std::list<Gib> m_Gibs;
880
899
// The amount of impulse force required to gib this, in kg * (m/s). 0 means no limit
@@ -894,10 +913,8 @@ ClassInfoGetters
894
913
// Map to store any object pointers
895
914
std::map<std::string, Entity *> m_ObjectValueMap;
896
915
897
-
// Damage mutliplier for this attachable
916
+
// Damage multiplier for this attachable
898
917
float m_DamageMultiplier;
899
-
// Whether damage multiplier for this attachable was redefined in .ini
900
-
bool m_DamageMultiplierRedefined;
901
918
902
919
// Intermediary drawing bitmap used to flip rotating bitmaps. Owned!
0 commit comments