Add unlock before manipulating entities
This commit is contained in:
parent
c5823c7133
commit
78ac272931
2 changed files with 6 additions and 0 deletions
|
|
@ -145,10 +145,12 @@
|
|||
// Find and delete all children (seat pads)
|
||||
var children = Entities.getChildrenIDs(tableEntityID);
|
||||
children.forEach(function(childID) {
|
||||
Entities.editEntity(childID, { locked: false });
|
||||
Entities.deleteEntity(childID);
|
||||
print("[pokerAdmin] deleted seat entity " + childID);
|
||||
});
|
||||
// Delete the table itself
|
||||
Entities.editEntity(tableEntityID, { locked: false });
|
||||
Entities.deleteEntity(tableEntityID);
|
||||
print("[pokerAdmin] deleted table entity " + tableEntityID);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -99,7 +99,9 @@
|
|||
if (isSeated) {
|
||||
MyAvatar.endSit(getSeatPosition(), getSeatRotation());
|
||||
isSeated = false;
|
||||
Entities.editEntity(entityID, { locked: false });
|
||||
Entities.editEntity(_entityID, { visible: true });
|
||||
Entities.editEntity(entityID, { locked: true });
|
||||
Controller.actionEvent.disconnect(onActionEvent);
|
||||
Messages.sendMessage("poker:seat", JSON.stringify({
|
||||
event: "stand",
|
||||
|
|
@ -138,7 +140,9 @@
|
|||
if (xhr.status === 200) {
|
||||
MyAvatar.beginSit(getSeatPosition(), getSeatRotation());
|
||||
isSeated = true;
|
||||
Entities.editEntity(entityID, { locked: false });
|
||||
Entities.editEntity(_entityID, { visible: false });
|
||||
Entities.editEntity(entityID, { locked: true });
|
||||
Controller.actionEvent.connect(onActionEvent);
|
||||
Messages.sendMessage("poker:seat", JSON.stringify({
|
||||
event: "sit",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue