diff --git a/src/world/Territory/Cell.cpp b/src/world/Territory/Cell.cpp index bbcfdd79..7f0e39cb 100644 --- a/src/world/Territory/Cell.cpp +++ b/src/world/Territory/Cell.cpp @@ -10,9 +10,7 @@ Sapphire::Cell::Cell() : m_bActive( false ), - m_bLoaded( false ), - m_playerCount( 0 ), - m_bUnloadPending( false ) + m_playerCount( 0 ) { m_bForcedActive = false; } @@ -22,9 +20,8 @@ Sapphire::Cell::~Cell() removeActors(); } -void Sapphire::Cell::init( uint32_t x, uint32_t y, TerritoryPtr pZone ) +void Sapphire::Cell::init( uint32_t x, uint32_t y ) { - m_pZone = pZone; m_posX = static_cast< uint16_t >( x ); m_posY = static_cast< uint16_t >( y ); @@ -57,9 +54,6 @@ void Sapphire::Cell::setActivity( bool state ) //} - if( m_bUnloadPending ) - cancelPendingUnload(); - } else if( m_bActive && !state ) { @@ -94,40 +88,17 @@ void Sapphire::Cell::removeActors() continue; } - if( m_bUnloadPending ) - { - - } - } m_playerCount = 0; - m_bLoaded = false; -} - -void Sapphire::Cell::queueUnloadPending() -{ - if( m_bUnloadPending ) - return; - - m_bUnloadPending = true; - -} - -void Sapphire::Cell::cancelPendingUnload() -{ - if( !m_bUnloadPending ) - return; } void Sapphire::Cell::unload() { - assert( m_bUnloadPending ); if( m_bActive ) return; removeActors(); - m_bUnloadPending = false; } diff --git a/src/world/Territory/Cell.h b/src/world/Territory/Cell.h index 23351b34..4a7dbbd6 100644 --- a/src/world/Territory/Cell.h +++ b/src/world/Territory/Cell.h @@ -21,18 +21,15 @@ private: uint16_t m_posY; ActorSet m_actors; bool m_bActive; - bool m_bLoaded; - bool m_bUnloadPending; uint16_t m_playerCount; - TerritoryPtr m_pZone; public: Cell(); ~Cell(); - void init( uint32_t x, uint32_t y, TerritoryPtr pZone ); + void init( uint32_t x, uint32_t y ); void addActor( Entity::ActorPtr pAct ); @@ -72,37 +69,8 @@ public: return m_bActive; } - bool isLoaded() const - { - return m_bLoaded; - } - - uint32_t getPlayerCount() const - { - return m_playerCount; - } - - bool isUnloadPending() const - { - return m_bUnloadPending; - } - - void setUnloadPending( bool up ) - { - m_bUnloadPending = up; - } - - void queueUnloadPending(); - - void cancelPendingUnload(); - void unload(); - void setPermanentActivity( bool val ) - { - m_bForcedActive = val; - } - bool isForcedActive() const { return m_bForcedActive; diff --git a/src/world/Territory/Territory.cpp b/src/world/Territory/Territory.cpp index d3d78dcb..c7fdb724 100644 --- a/src/world/Territory/Territory.cpp +++ b/src/world/Territory/Territory.cpp @@ -214,7 +214,7 @@ void Sapphire::Territory::pushActor( Entity::ActorPtr pActor ) if( !pCell ) { pCell = create( cx, cy ); - pCell->init( cx, cy, shared_from_this() ); + pCell->init( cx, cy ); } pCell->addActor( pActor ); @@ -576,12 +576,10 @@ void Sapphire::Territory::updateCellActivity( uint32_t x, uint32_t y, int32_t ra if( isCellActive( posX, posY ) ) { pCell = create( posX, posY ); - pCell->init( posX, posY, shared_from_this() ); + pCell->init( posX, posY ); pCell->setActivity( true ); - assert( !pCell->isLoaded() ); - } } else @@ -590,11 +588,6 @@ void Sapphire::Territory::updateCellActivity( uint32_t x, uint32_t y, int32_t ra if( isCellActive( posX, posY ) && !pCell->isActive() ) { pCell->setActivity( true ); - - if( !pCell->isLoaded() ) - { - - } } else if( !isCellActive( posX, posY ) && pCell->isActive() ) pCell->setActivity( false ); @@ -623,7 +616,7 @@ void Sapphire::Territory::updateActorPosition( Entity::Actor& actor ) if( !pCell ) { pCell = create( cellX, cellY ); - pCell->init( cellX, cellY, shared_from_this() ); + pCell->init( cellX, cellY ); } // If object moved cell