mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
move entity Action serialization to PhysicalEntitySimulation
This commit is contained in:
parent
3db915c432
commit
86c60204fd
2 changed files with 1 additions and 2 deletions
|
@ -62,7 +62,6 @@ void EntitySimulation::prepareEntityForDelete(EntityItemPointer entity) {
|
||||||
assert(entity->isDead());
|
assert(entity->isDead());
|
||||||
if (entity->isSimulated()) {
|
if (entity->isSimulated()) {
|
||||||
QMutexLocker lock(&_mutex);
|
QMutexLocker lock(&_mutex);
|
||||||
entity->clearActions(getThisPointer());
|
|
||||||
removeEntityInternal(entity);
|
removeEntityInternal(entity);
|
||||||
if (entity->getElement()) {
|
if (entity->getElement()) {
|
||||||
_deadEntities.insert(entity);
|
_deadEntities.insert(entity);
|
||||||
|
@ -152,7 +151,6 @@ void EntitySimulation::sortEntitiesThatMoved() {
|
||||||
void EntitySimulation::addEntity(EntityItemPointer entity) {
|
void EntitySimulation::addEntity(EntityItemPointer entity) {
|
||||||
QMutexLocker lock(&_mutex);
|
QMutexLocker lock(&_mutex);
|
||||||
assert(entity);
|
assert(entity);
|
||||||
entity->deserializeActions();
|
|
||||||
if (entity->isMortal()) {
|
if (entity->isMortal()) {
|
||||||
_mortalEntities.insert(entity);
|
_mortalEntities.insert(entity);
|
||||||
uint64_t expiry = entity->getExpiry();
|
uint64_t expiry = entity->getExpiry();
|
||||||
|
|
|
@ -48,6 +48,7 @@ void PhysicalEntitySimulation::addEntityInternal(EntityItemPointer entity) {
|
||||||
QMutexLocker lock(&_mutex);
|
QMutexLocker lock(&_mutex);
|
||||||
assert(entity);
|
assert(entity);
|
||||||
assert(!entity->isDead());
|
assert(!entity->isDead());
|
||||||
|
entity->deserializeActions();
|
||||||
uint8_t region = _space->getRegion(entity->getSpaceIndex());
|
uint8_t region = _space->getRegion(entity->getSpaceIndex());
|
||||||
bool maybeShouldBePhysical = (region < workload::Region::R3 || region == workload::Region::UNKNOWN) && entity->shouldBePhysical();
|
bool maybeShouldBePhysical = (region < workload::Region::R3 || region == workload::Region::UNKNOWN) && entity->shouldBePhysical();
|
||||||
bool canBeKinematic = region <= workload::Region::R3;
|
bool canBeKinematic = region <= workload::Region::R3;
|
||||||
|
|
Loading…
Reference in a new issue