2023-05-11 16:50:11 -04:00
|
|
|
#include <std_include.hpp>
|
|
|
|
#include "loader/component_loader.hpp"
|
|
|
|
|
2023-09-06 08:08:38 -04:00
|
|
|
#include <utils/hook.hpp>
|
|
|
|
|
2023-05-11 16:50:11 -04:00
|
|
|
namespace experimental
|
|
|
|
{
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
utils::hook::detour liveinventory_getitemquantity_hook;
|
|
|
|
int liveinventory_getitemquantity_stub(int controller_index, const int item_id)
|
|
|
|
{
|
|
|
|
return 1; // TODO: Higher quanity for zombie consumable loot
|
|
|
|
|
|
|
|
return liveinventory_getitemquantity_hook.invoke<int>(controller_index, item_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class component final : public component_interface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void post_unpack() override
|
|
|
|
{
|
|
|
|
liveinventory_getitemquantity_hook.create(0x1437F6ED0_g, liveinventory_getitemquantity_stub);
|
|
|
|
|
|
|
|
utils::hook::set(0x142DD0E10_g, 0xC301B0); // Live_Qos_Finished
|
|
|
|
utils::hook::set(0x1438C2C70_g, 0xC301B0); // Live_Contracts? related to bdUNK125
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
REGISTER_COMPONENT(experimental::component)
|