Fix snd/sndcurve not using original assets as fallback, bump IW4Of (#791)
This commit is contained in:
@ -8,6 +8,8 @@ namespace Assets
|
||||
if (!header->data) this->loadEfx(header, name, builder); // Check if we have an editor fx
|
||||
if (!header->data) this->loadFromIW4OF(header, name, builder); // Check if we need to import a new one into the game
|
||||
if (!header->data /*&& !builder->isPrimaryAsset()*/) this->loadNative(header, name, builder); // Check if there is a native one
|
||||
|
||||
assert(header->data);
|
||||
}
|
||||
|
||||
void IFxEffectDef::loadFxElemVisuals(Game::FxElemVisuals* visuals, char elemType, Components::ZoneBuilder::Zone* builder, Utils::Stream::Reader* reader)
|
||||
|
@ -12,7 +12,10 @@ namespace Assets
|
||||
if (!header->data) this->loadFromDisk(header, name, builder); // Check if we need to import a new one into the game
|
||||
if (!header->data) this->loadNative(header, name, builder); // Check if there is a native one
|
||||
|
||||
assert(header->data);
|
||||
if (!header->data)
|
||||
{
|
||||
AssertUnreachable;
|
||||
}
|
||||
}
|
||||
|
||||
void IMaterialTechniqueSet::loadNative(Game::XAssetHeader* header, const std::string& name, Components::ZoneBuilder::Zone* /*builder*/)
|
||||
|
@ -26,5 +26,10 @@ namespace Assets
|
||||
void ISndCurve::load(Game::XAssetHeader* header, const std::string& name, Components::ZoneBuilder::Zone* builder)
|
||||
{
|
||||
header->sndCurve = builder->getIW4OfApi()->read<Game::SndCurve>(Game::XAssetType::ASSET_TYPE_SOUND_CURVE, name);
|
||||
|
||||
if (!header->sndCurve)
|
||||
{
|
||||
header->sndCurve = Components::AssetHandler::FindOriginalAsset(Game::XAssetType::ASSET_TYPE_SOUND_CURVE, name.data()).sndCurve;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,11 @@ namespace Assets
|
||||
void Isnd_alias_list_t::load(Game::XAssetHeader* header, const std::string& name, Components::ZoneBuilder::Zone* builder)
|
||||
{
|
||||
header->sound = builder->getIW4OfApi()->read<Game::snd_alias_list_t>(Game::XAssetType::ASSET_TYPE_SOUND, name);
|
||||
|
||||
if (!header->sound)
|
||||
{
|
||||
header->sound = Components::AssetHandler::FindOriginalAsset(Game::XAssetType::ASSET_TYPE_SOUND_CURVE, name.data()).sound;
|
||||
}
|
||||
}
|
||||
|
||||
void Isnd_alias_list_t::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
||||
|
@ -761,7 +761,9 @@ namespace Components
|
||||
|
||||
iw4of::params_t ZoneBuilder::Zone::getIW4OfApiParams()
|
||||
{
|
||||
iw4of::params_t params;
|
||||
iw4of::params_t params{};
|
||||
|
||||
params.write_only_once = true;
|
||||
|
||||
params.find_other_asset = [this](int type, const std::string& name) -> void*
|
||||
{
|
||||
|
Reference in New Issue
Block a user