fix: only diff entity list if exists

This commit is contained in:
cha0s 2019-03-23 20:06:06 -05:00
parent 3cfd46b982
commit fc030608bb

View File

@ -29,6 +29,10 @@ class InformedBase extends Trait {
} }
reduceStateDiffForEntityList(diff, position) { reduceStateDiffForEntityList(diff, position) {
// Only if entity list exists.
if (!diff.entityList) {
return diff;
}
// Reduce the entity list. // Reduce the entity list.
const informSize = this.entity.informSize.toJS(); const informSize = this.entity.informSize.toJS();
const nearbyEntities = this.entity.nearbyEntities(informSize, position); const nearbyEntities = this.entity.nearbyEntities(informSize, position);