X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.cpp;h=8138bc11d89c328d20374888284aa8521f6d28d7;hb=b02da898c7c8a08141df4e797774a61cf5e0163f;hp=fdf8125872c1df23a57c3f8187837d96da125d2f;hpb=be7b4addf295d6193ba2527cdd17cdb524339aed;p=l2e.git diff --git a/src/battle/Hero.cpp b/src/battle/Hero.cpp index fdf8125..8138bc1 100644 --- a/src/battle/Hero.cpp +++ b/src/battle/Hero.cpp @@ -164,6 +164,7 @@ void Hero::CreateTypeDescription() { int stringId(TypeDescription::GetTypeId("String")); TypeDescription &td(TypeDescription::CreateOrGet("Hero")); + td.SetConstructor(&Construct); td.SetSize(sizeof(Hero)); td.AddField("name", FieldDescription(((char *)&h.name) - ((char *)&h), stringId, true)); @@ -182,4 +183,8 @@ void Hero::CreateTypeDescription() { td.AddField("meleeAnimation", FieldDescription(((char *)&h.meleeAnimation) - ((char *)&h), animationId, true)); } +void Hero::Construct(void *data) { + new (data) Hero; +} + }