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)
|
// Find and delete all children (seat pads)
|
||||||
var children = Entities.getChildrenIDs(tableEntityID);
|
var children = Entities.getChildrenIDs(tableEntityID);
|
||||||
children.forEach(function(childID) {
|
children.forEach(function(childID) {
|
||||||
|
Entities.editEntity(childID, { locked: false });
|
||||||
Entities.deleteEntity(childID);
|
Entities.deleteEntity(childID);
|
||||||
print("[pokerAdmin] deleted seat entity " + childID);
|
print("[pokerAdmin] deleted seat entity " + childID);
|
||||||
});
|
});
|
||||||
// Delete the table itself
|
// Delete the table itself
|
||||||
|
Entities.editEntity(tableEntityID, { locked: false });
|
||||||
Entities.deleteEntity(tableEntityID);
|
Entities.deleteEntity(tableEntityID);
|
||||||
print("[pokerAdmin] deleted table entity " + tableEntityID);
|
print("[pokerAdmin] deleted table entity " + tableEntityID);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,9 @@
|
||||||
if (isSeated) {
|
if (isSeated) {
|
||||||
MyAvatar.endSit(getSeatPosition(), getSeatRotation());
|
MyAvatar.endSit(getSeatPosition(), getSeatRotation());
|
||||||
isSeated = false;
|
isSeated = false;
|
||||||
|
Entities.editEntity(entityID, { locked: false });
|
||||||
Entities.editEntity(_entityID, { visible: true });
|
Entities.editEntity(_entityID, { visible: true });
|
||||||
|
Entities.editEntity(entityID, { locked: true });
|
||||||
Controller.actionEvent.disconnect(onActionEvent);
|
Controller.actionEvent.disconnect(onActionEvent);
|
||||||
Messages.sendMessage("poker:seat", JSON.stringify({
|
Messages.sendMessage("poker:seat", JSON.stringify({
|
||||||
event: "stand",
|
event: "stand",
|
||||||
|
|
@ -138,7 +140,9 @@
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
MyAvatar.beginSit(getSeatPosition(), getSeatRotation());
|
MyAvatar.beginSit(getSeatPosition(), getSeatRotation());
|
||||||
isSeated = true;
|
isSeated = true;
|
||||||
|
Entities.editEntity(entityID, { locked: false });
|
||||||
Entities.editEntity(_entityID, { visible: false });
|
Entities.editEntity(_entityID, { visible: false });
|
||||||
|
Entities.editEntity(entityID, { locked: true });
|
||||||
Controller.actionEvent.connect(onActionEvent);
|
Controller.actionEvent.connect(onActionEvent);
|
||||||
Messages.sendMessage("poker:seat", JSON.stringify({
|
Messages.sendMessage("poker:seat", JSON.stringify({
|
||||||
event: "sit",
|
event: "sit",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue