mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:43:35 +02:00
Protections against null pointers
This commit is contained in:
parent
872ec21822
commit
a1e6d9e7a1
2 changed files with 13 additions and 2 deletions
|
@ -649,11 +649,15 @@ void AvatarData::startPlaying() {
|
|||
}
|
||||
|
||||
void AvatarData::setPlayFromCurrentLocation(bool playFromCurrentLocation) {
|
||||
_player->setPlayFromCurrentLocation(playFromCurrentLocation);
|
||||
if (_player) {
|
||||
_player->setPlayFromCurrentLocation(playFromCurrentLocation);
|
||||
}
|
||||
}
|
||||
|
||||
void AvatarData::setPlayerLoop(bool loop) {
|
||||
_player->setLoop(loop);
|
||||
if (_player) {
|
||||
_player->setLoop(loop);
|
||||
}
|
||||
}
|
||||
|
||||
void AvatarData::play() {
|
||||
|
|
|
@ -186,6 +186,13 @@ void ScriptEngine::setIsAvatar(bool isAvatar) {
|
|||
_avatarIdentityTimer->start(AVATAR_IDENTITY_PACKET_SEND_INTERVAL_MSECS);
|
||||
_avatarBillboardTimer->start(AVATAR_BILLBOARD_PACKET_SEND_INTERVAL_MSECS);
|
||||
}
|
||||
|
||||
if (!_isAvatar) {
|
||||
delete _avatarIdentityTimer;
|
||||
_avatarIdentityTimer = NULL;
|
||||
delete _avatarBillboardTimer;
|
||||
_avatarBillboardTimer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEngine::setAvatarData(AvatarData* avatarData, const QString& objectName) {
|
||||
|
|
Loading…
Reference in a new issue