scripts/token-attacher.js
//Detach Elements when they get deleted
Detach Elements when they get deleted
Detach Elements when they get deleted
static DetachAfterDelete(type, document, options, userId){
			if(!TokenAttacher.isFirstActiveGM()) return; 
			if(getProperty(options, `${moduleName}.update`)) return;
			let objParent = getProperty(document, `data.flags.${moduleName}.parent`) || "";
			if(objParent !== ""){
				if(TokenAttacher.isFirstActiveGM()) TokenAttacher._DetachFromToken(objParent, {type:type, data:[document.data._id]}, true, {skip_update:true});
				else game.socket.emit(`module.${moduleName}`, {event: `DetachFromToken`, eventdata: [objParent, {type:type, data:[document.data._id]}, true, {skip_update:true}]});
			}
		}
static DetachAfterDelete ( type , document , options , userId ) { if ( ! TokenAttacher . isFirstActiveGM ( ) ) return ; if ( getProperty ( options , ` ${ moduleName } ` ) ) return ; let objParent = getProperty ( document , ` ${ moduleName } ` ) || "" ; if ( objParent !== "" ) { if ( TokenAttacher . isFirstActiveGM ( ) ) TokenAttacher . _DetachFromToken ( objParent , { type : type , data : [ document . data . _id ] } , true , { skip_update : true } ) ; else game . socket . emit ( ` ${ moduleName } ` , { event : ` ` , eventdata : [ objParent , { type : type , data : [ document . data . _id ] } , true , { skip_update : true } ] } ) ; } }
Detach Elements when they get deleted
Detach Elements when they get deleted