@@ -24,8 +24,10 @@ export const regenerateCharacter = async (actor) => {
2424 // update any actor tokens in the scene, too
2525 for ( const token of actor . getActiveTokens ( ) ) {
2626 await token . document . update ( {
27- img : actor . token . img ,
2827 name : actor . name ,
28+ texture : {
29+ src : actor . prototypeToken . texture . src ,
30+ } ,
2931 } ) ;
3032 }
3133} ;
@@ -98,9 +100,11 @@ const randomCharacter = async () => {
98100 } ,
99101 img : portrait ,
100102 items : itemData ,
101- token : {
102- img : token ,
103- name,
103+ prototypeToken : {
104+ name : name ,
105+ texture : {
106+ src : token ,
107+ } ,
104108 } ,
105109 type : "character" ,
106110 } ;
@@ -167,10 +171,15 @@ const maybeGiveStartingBonus = async (actor) => {
167171 const followerData = simpleData ( bonusFollower ) ;
168172 const firstName = actor . name . split ( " " ) [ 0 ] ;
169173 followerData . name = `${ firstName } 's ${ followerData . name } ` ;
170- const follower = await DISActor . create ( followerData ) ;
171- follower . sheet . render ( true ) ;
172- // TODO: set notes on char sheet?
173- // "You have a starting follower: "
174+ if ( game . user . can ( "ACTOR_CREATE" ) ) {
175+ const follower = await DISActor . create ( followerData ) ;
176+ follower . sheet . render ( true ) ;
177+ } else {
178+ ui . notifications . info (
179+ `Ask the GM to create an NPC for you: ${ followerData . name } ` ,
180+ { permanent : true }
181+ ) ;
182+ }
174183 }
175184} ;
176185
@@ -307,9 +316,10 @@ export const regenerateNpc = async (actor) => {
307316 // update any actor tokens in the scene, too
308317 for ( const token of actor . getActiveTokens ( ) ) {
309318 await token . document . update ( {
310- // TODO: verify path
311- img : actor . token . img ,
312319 name : actor . name ,
320+ texture : {
321+ src : actor . prototypeToken . texture . src ,
322+ } ,
313323 } ) ;
314324 }
315325} ;
@@ -378,9 +388,11 @@ const randomNpc = async () => {
378388 } ,
379389 img : portrait ,
380390 items : [ ] ,
381- token : {
382- img : token ,
383- name,
391+ prototypeToken : {
392+ name : name ,
393+ texture : {
394+ src : token ,
395+ } ,
384396 } ,
385397 type : "npc" ,
386398 } ;
0 commit comments