Skip to content

Commit

Permalink
Fix - Player dropped tokens shouldn't be locked; shouldn't get token …
Browse files Browse the repository at this point in the history
…customizations
  • Loading branch information
Azmoria committed Sep 29, 2023
1 parent cf00487 commit e4f233a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CharactersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const debounce_add_extras = mydebounce(() => {
name: monsterData.name,
player_owned: true,
share_vision: true,
hidden: false
hidden: false,
locked: false
}
if(!window.TOKEN_OBJECTS[playerTokenID])
tokenPosition = convert_point_from_view_to_map(tokenPosition.x, tokenPosition.y)
Expand Down
11 changes: 7 additions & 4 deletions TokensPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ function update_pc_token_rows() {
*/


function create_and_place_token(listItem, hidden = undefined, specificImage= undefined, eventPageX = undefined, eventPageY = undefined, disableSnap = false, nameOverride = "", mapPoint=false, extraOptions={}) {
function create_and_place_token(listItem, hidden = undefined, specificImage= undefined, eventPageX = undefined, eventPageY = undefined, disableSnap = false, nameOverride = "", mapPoint=false, extraOptions=undefined) {


if (listItem === undefined) {
Expand Down Expand Up @@ -930,9 +930,12 @@ function create_and_place_token(listItem, hidden = undefined, specificImage= und
}
return;
}

let options = {...window.TOKEN_SETTINGS}
// set up whatever you need to. We'll override a few things after
let options = {...window.TOKEN_SETTINGS, ...find_token_options_for_list_item(listItem)}; // we may need to put this in specific places within the switch statement below
if(extraOptions == undefined){
options = {...options, ...find_token_options_for_list_item(listItem)}; // we may need to put this in specific places within the switch statement below
}

options.name = listItem.name;


Expand Down Expand Up @@ -1140,7 +1143,7 @@ function create_and_place_token(listItem, hidden = undefined, specificImage= und
}
options.imgsrc = random_image_for_item(listItem, specificImage);
// TODO: figure out if we still need to do this, and where they are coming from
if(extraOptions != {}){
if(extraOptions != undefined){
options = {
...options,
...extraOptions
Expand Down

0 comments on commit e4f233a

Please sign in to comment.