[Fix] Player Created Regions (#1855)

* Fixed so that creating regions without behaviors work for players. Fixed so that creating regions with behaviors works via GmEmit for players

* Updated previous uses of emitAsGM to emitGMUpdate

* Fixed linting

* Update module/documents/chatMessage.mjs

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
WBHarry 2026-05-02 22:34:53 +02:00 committed by GitHub
parent 54d1b2bdc0
commit edbf5aa55f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 108 additions and 69 deletions

View file

@ -1,4 +1,4 @@
import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs';
import { emitGMUpdate, GMUpdateEvent } from '../systemRegistration/socket.mjs';
import { LevelOptionType } from '../data/levelTier.mjs';
import DHFeature from '../data/item/feature.mjs';
import { createScrollText, damageKeyToNumber, getDamageKey, createShallowProxy } from '../helpers/utils.mjs';
@ -827,7 +827,7 @@ export default class DhpActor extends Actor {
const u = updates[key];
if (key === 'items') {
Object.values(u).forEach(async item => {
await emitAsGM(
await emitGMUpdate(
GMUpdateEvent.UpdateDocument,
item.target.update.bind(item.target),
item.resources,
@ -836,7 +836,7 @@ export default class DhpActor extends Actor {
});
} else {
if (Object.keys(u.resources).length > 0) {
await emitAsGM(
await emitGMUpdate(
GMUpdateEvent.UpdateDocument,
u.target.update.bind(u.target),
u.resources,