Fixed issue with water bottles having no upd
object in rare cases killing client
This commit is contained in:
parent
ddd5d69eda
commit
b9973e609f
@ -127,6 +127,11 @@ export class HealthController
|
|||||||
const consumedItemMaxResource = this.itemHelper.getItem(itemToConsume._tpl)[1]._props.MaxResource;
|
const consumedItemMaxResource = this.itemHelper.getItem(itemToConsume._tpl)[1]._props.MaxResource;
|
||||||
if (consumedItemMaxResource > 1)
|
if (consumedItemMaxResource > 1)
|
||||||
{
|
{
|
||||||
|
if (!itemToConsume.upd)
|
||||||
|
{
|
||||||
|
itemToConsume.upd = {};
|
||||||
|
}
|
||||||
|
|
||||||
if (itemToConsume.upd.FoodDrink === undefined)
|
if (itemToConsume.upd.FoodDrink === undefined)
|
||||||
{
|
{
|
||||||
itemToConsume.upd.FoodDrink = { HpPercent: consumedItemMaxResource - request.count };
|
itemToConsume.upd.FoodDrink = { HpPercent: consumedItemMaxResource - request.count };
|
||||||
|
Loading…
Reference in New Issue
Block a user