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) { mergeDiff(original, update) {
const merged = {}; const merged = {};
if (update.emit) { if (original.emit || update.emit) {
merged.emit = { merged.emit = {
...original.emit, ...original.emit,
...update.emit, ...update.emit,

View File

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

View File

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

View File

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