Weapon dumping (waiting for IW4OF support)
This commit is contained in:
parent
01a1567173
commit
cc895c766e
@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user