Open gememe opened 1 year ago
@gememe I think we're meant to create extra data via RE::BSExtraData::Create\<T> method, i.e.:
auto newExtra = RE::BSExtraData::Create<RE::ExtraRadius>();
UPD: Just checked - it still doesnt work for ExtraRadius (and plenty of other Extra data types), just makes the game crash.
As a workaround, it's easy enough to just complete the definition of the constructor directly in the header file, like so:
ExtraRadius() : ExtraRadius(0) {}
ExtraRadius(float a_radius) : BSExtraData(), radius(a_radius), pad14(0) { stl::emplace_vtable(this); }
ExtraDataType GetType() const override { return ExtraDataType::kRadius; };
bool IsNotEqual(const BSExtraData* a_rhs) const override {
auto rhs = static_cast<const ExtraRadius*>(a_rhs);
return radius != rhs->radius;
};
Then, the the following works:
xRadius = new RE::ExtraRadius();
ref->extraList.Add(xRadius);
Trying to create a new RE::ExtraRadius results in 3 unresolved externals.
ExtraRadius.cpp
seems to be missing.