diff --git a/src/Components/Modules/AssetInterfaces/IWeapon.cpp b/src/Components/Modules/AssetInterfaces/IWeapon.cpp index 40e8fdd5..57a65816 100644 --- a/src/Components/Modules/AssetInterfaces/IWeapon.cpp +++ b/src/Components/Modules/AssetInterfaces/IWeapon.cpp @@ -782,4 +782,26 @@ namespace Assets buffer->popBlock(); } + + IWeapon::IWeapon() + { + Components::Command::Add("dumpweapon", [](const Components::Command::Params* params) + { + if (params->size() < 2) return; + + std::string weapon = params->get(1); + + const auto header = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_WEAPON, weapon.data()); + if (header.data) + { + Components::ZoneBuilder::RefreshExporterWorkDirectory(); + Components::ZoneBuilder::GetExporter()->write(Game::XAssetType::ASSET_TYPE_WEAPON, header.data); + } + else + { + Components::Logger::Print("Could not find weapon {}!\n", weapon); + } + } + ); + } } diff --git a/src/Components/Modules/AssetInterfaces/IWeapon.hpp b/src/Components/Modules/AssetInterfaces/IWeapon.hpp index e9f05d5b..55d5ae5b 100644 --- a/src/Components/Modules/AssetInterfaces/IWeapon.hpp +++ b/src/Components/Modules/AssetInterfaces/IWeapon.hpp @@ -6,6 +6,7 @@ namespace Assets { public: Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_WEAPON; } + IWeapon(); void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override; void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;