fix: merge

This commit is contained in:
cha0s 2024-09-05 16:52:22 -05:00
parent 2733968fa4
commit 9df38d5952
4 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ export default class EmitterComponent extends Component {
}
mergeDiff(original, update) {
const merged = {};
if (update.emit) {
if (original.emit || update.emit) {
merged.emit = {
...original.emit,
...update.emit,

View File

@ -3,7 +3,7 @@ import Component from '@/ecs/component.js';
export default class Interlocutor extends Component {
mergeDiff(original, update) {
const merged = {};
if (update.dialogue) {
if (original.dialogue || update.dialogue) {
merged.dialogue = {
...original.dialogue,
...update.dialogue,

View File

@ -3,7 +3,7 @@ import Component from '@/ecs/component.js';
export default class Sound extends Component {
mergeDiff(original, update) {
const merged = {};
if (update.play) {
if (original.play || update.play) {
merged.play = [
...(original.play ?? []),
...update.play,

View File

@ -9,7 +9,7 @@ export const DamageTypes = {
export default class Vulnerable extends Component {
mergeDiff(original, update) {
const merged = {};
if (update.damage) {
if (original.damage || update.damage) {
merged.damage = {
...original.damage,
...update.damage,