Skip to content

Commit

Permalink
Remove grenade from inventory + fix durability conveys
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmoonen committed May 15, 2024
1 parent a97ddb5 commit 5427c59
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/servers/ZoneServer2016/zoneserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5653,7 +5653,9 @@ export class ZoneServer2016 extends EventEmitter {
durability = 100;
break;
case this.isConvey(itemDefinitionId):
durability = Math.floor(Math.random() * 5400);
durability = forceMaxDurability
? 5400
: Math.floor(Math.random() * 5400);
break;
case this.isGeneric(itemDefinitionId):
durability = 2000;
Expand Down Expand Up @@ -7672,6 +7674,19 @@ export class ZoneServer2016 extends EventEmitter {
"Update.ProjectileLaunch",
{}
);

if (itemDefinition.ITEM_CLASS == ItemClasses.THROWABLES) {
const grenadeAmount = client.character.getInventoryItemAmount(
weaponItem.itemDefinitionId
);
// Remove loadout item if there's no more grenades in the inventory, this check is only temporary until removeInventoryItems is fixed
if (grenadeAmount <= 0) {
this.removeInventoryItem(client.character, weaponItem);
return;
}
this.removeInventoryItems(client, weaponItem.itemDefinitionId);
return;
}
this.damageItem(client, weaponItem, 5);
}

Expand Down

0 comments on commit 5427c59

Please sign in to comment.