fix: merge
This commit is contained in:
parent
2733968fa4
commit
9df38d5952
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user