Skip to content

When a player's faction tier changes, the server sometimes crashes.

I think this happens if you've unequiped an item (without replacing it with something else) during a session.

Line 201 in server/components/equipment.js

Object.keys(this.eq).forEach(function(slot) {

Causes us to iterate through all keys in the object and we never delete keys when we unequip something, we only set them to null.

{
   head: null,
   neck: 12
}

And when we ask the inventory for an item with an id of null, it returns null. Then this line crashes the server:

var factions = item.factions;

Edited by Big Bad Waffle