Skip to content

Commit b4e0cca

Browse files
committed
[DBC] fix crash when trying to access owner's override DB from pets
1 parent 7525c9e commit b4e0cca

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

engine/dbc/dbc.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
class dbc_t;
5050
struct player_t;
51+
struct pet_t;
5152
struct item_t;
5253

5354
struct stat_data_t
@@ -612,7 +613,7 @@ const spell_data_t* find_spell( const T* obj, U data )
612613
if constexpr ( std::is_base_of_v<T, player_t> )
613614
{
614615
if ( obj->sim->dbc_override->find_spell( spell_id, obj->dbc->ptr ) == return_spell )
615-
return_spell = T::clone_dbc_override_spell( obj, return_spell );
616+
return_spell = T::clone_dbc_override_spell( obj->get_owner_or_self(), return_spell );
616617
}
617618

618619
return return_spell;
@@ -638,7 +639,7 @@ const spell_data_t* find_spell( const T* obj, U data )
638639
( as<int>( return_spell->class_family() ) == dbc::get_class_spell_family( obj->type ) ||
639640
return_spell->affected_by_label( dbc::get_class_spell_label( obj->type ) ) ) )
640641
{
641-
return_spell = T::clone_dbc_override_spell( obj, return_spell );
642+
return_spell = T::clone_dbc_override_spell( obj->get_owner_or_self(), return_spell );
642643
}
643644
}
644645

0 commit comments

Comments
 (0)