Jelajahi Sumber

Added elemental constructor/destructor (#9144)

Added the previously unused constructor and destructor call for elementals.
Follow up to 8515dee
Lemongrass3110 2 bulan lalu
induk
melakukan
273d103425
2 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 1 0
      src/map/elemental.cpp
  2. 2 0
      src/map/unit.cpp

+ 1 - 0
src/map/elemental.cpp

@@ -242,6 +242,7 @@ int32 elemental_data_received(s_elemental *ele, bool flag) {
 
 	if( !sd->ed ) {	// Initialize it after first summon.
 		sd->ed = ed = (s_elemental_data*)aCalloc(1,sizeof(s_elemental_data));
+		new (sd->ed) s_elemental_data();
 		ed->bl.type = BL_ELEM;
 		ed->bl.id = npc_get_new_npc_id();
 		ed->master = sd;

+ 2 - 0
src/map/unit.cpp

@@ -4061,6 +4061,8 @@ int32 unit_free(struct block_list *bl, clr_type clrtype)
 
 			skill_clear_unitgroup(bl);
 			status_change_clear(bl,1);
+
+			ed->~s_elemental_data();
 			break;
 		}
 	}