Resolves an issue where item is null but is accessed but not doing that code and instead consulting the EntityManager for a valid Entity, alongside nullifying the m_Owner objectID should the pet be destroyed and timer still exist.
Update PetComponent.cpp
Add nullptr check
Add back timer
Update PetComponent.cpp
speculative fix for a different crash
Why are we accessing something before checking if its null
* move the pet minigame table loading logic out of petcomponent
* misc fixes
* actually, using paths is dumb here when they're already char strings. why bother? silly me.
* removed unga bunga reference-casting
* add back in puzzle not found error message
* pre-allocate unordered map and make getter const-correct
* Update dDatabase/CDClientDatabase/CDClientTables/CDTamingBuildPuzzleTable.cpp
Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
---------
Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
* Assorted pet improvements
* remove unecessary include
* updates to address some feedback
* fixed database code for testing
* messinng around with tables
* updated to address feedback
* fix world hang
* Remove at() in CDLootTableTable.cpp
* Uncapitalize LOT variable
* Uncapitalize LOT variable
* Assorted pet improvements
* remove unecessary include
* updates to address some feedback
* fixed database code for testing
* Removed reference member (for now)
* Removed cmake flag
* Components: Make ComponentType inline
Prevents the next commits ODR violation
* Components: Add new components
* Entity: Add headers
inline script component ComponentType
* Components: Flip constructor argument order
Entity comes first always
* Entity: Add generic AddComponent
Allows for much easier adding of components and is error proof by not allowing the user to add more than 1 of a specific component type to an Entity.
* Entity: Migrate all component constructors
Move all to the new variadic templates AddComponent function to reduce clutter and ways the component map is modified.
The new function makes no assumptions. Component is assumed to not exist and is checked for with operator[]. This will construct a null component which will then be newed if the component didnt exist, or it will just get the current component if it does already exist. No new component will be allocated or constructed if the component already exists and the already existing pointer is returned instead.
* Entity: Add placement new
For the case where the component may already exist, use a placement new to construct the component again, it would be constructed again, but would not need to go through the allocator.
* Entity: Add comments on likely new code
* Tests: Fix tests
* Update Entity.cpp
* Update SGCannon.cpp
* Entity: call destructor when re-constructing
* Update Entity.cpp
Update Entity.cpp
---------
Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
* Breakout rest of the enums from dcommonvars
so we don't have to deal with merge conflicts
ePlayerFlags is not a scoped enum, yet, due to it's complexity
* address feedback
* make player flag types consistent
* fix typo
* breakout the component types into a scoped enum
tested that things are the same as they were before
* fix missed rename
* fix brick-by-brick name to be crafting
because that's what it is