fix: achievements crashes

This commit is contained in:
Byte
2026-06-24 22:27:22 +02:00
parent 028dcdce41
commit e7a44db374
8 changed files with 16 additions and 11 deletions
+5 -1
View File
@@ -2,6 +2,7 @@
#include "Monster.h"
#include "Item.h"
#include "GenericStats.h"
GenericStats *GenericStats::instance = nullptr;
@@ -835,7 +836,10 @@ byteArray GenericStats::param_itemsSmelted(int id, int aux, int count)
byteArray GenericStats::param_itemsUsed(shared_ptr<Player> plr, shared_ptr<ItemInstance> itm)
{
if ( (plr != nullptr) && (itm != nullptr) ) return instance->getParam_itemsUsed(plr, itm);
if ((plr != nullptr) && (itm != nullptr)) {
if (itm->id == Item::porkChop_cooked_Id) return instance->param_eatPorkChop();
return instance->getParam_itemsUsed(plr, itm);
}
else return instance->getParam_noArgs();
}