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