mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Handle AC script not being able to create an entity
This commit is contained in:
parent
1cc215e14b
commit
6a88398e8e
1 changed files with 13 additions and 9 deletions
|
@ -74,9 +74,12 @@
|
|||
};
|
||||
|
||||
entityID = Entities.addEntity(properties);
|
||||
// TODO: Handle failure adding entity?
|
||||
if (!Uuid.isNull(entityID)) {
|
||||
updateTimestampTimer = Script.setInterval(onUpdateTimestamp, TIMESTAMP_UPDATE_INTERVAL);
|
||||
return true;
|
||||
}
|
||||
|
||||
updateTimestampTimer = Script.setInterval(onUpdateTimestamp, TIMESTAMP_UPDATE_INTERVAL);
|
||||
return false;
|
||||
}
|
||||
|
||||
function find(scriptUUID) {
|
||||
|
@ -205,13 +208,14 @@
|
|||
}
|
||||
|
||||
function play(recording, position, orientation) {
|
||||
isPlayingRecording = true;
|
||||
recordingFilename = recording;
|
||||
|
||||
log("Play new recording " + recordingFilename);
|
||||
|
||||
Entity.create(recordingFilename, position, orientation, scriptUUID);
|
||||
playRecording(recordingFilename, position, orientation);
|
||||
if (Entity.create(recordingFilename, position, orientation, scriptUUID)) {
|
||||
log("Play new recording " + recordingFilename);
|
||||
isPlayingRecording = true;
|
||||
recordingFilename = recording;
|
||||
playRecording(recordingFilename, position, orientation);
|
||||
} else {
|
||||
log("Could not create entity to play new recording " + recordingFilename);
|
||||
}
|
||||
}
|
||||
|
||||
function autoPlay() {
|
||||
|
|
Loading…
Reference in a new issue