| 131 | } |
| 132 | |
| 133 | void GameObject::autoFixTilePos() { |
| 134 | if ( ( mFlags & GObjFlags::GAMEOBJECT_AUTO_FIX_TILE_POS ) && NULL != mLayer && |
| 135 | mLayer->getType() == MAP_LAYER_TILED ) { |
| 136 | Vector2i CurPos = getTilePosition(); |
| 137 | |
| 138 | assignTilePos(); |
| 139 | |
| 140 | Vector2i NewPos = getTilePosition(); |
| 141 | |
| 142 | if ( CurPos != NewPos ) { |
| 143 | TileMapLayer* TLayer = static_cast<TileMapLayer*>( mLayer ); |
| 144 | |
| 145 | if ( TLayer->getGameObject( CurPos ) == this ) { |
| 146 | TLayer->moveTileObject( CurPos, NewPos ); |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | void GameObject::assignTilePos() { |
| 153 | TileMapLayer* TLayer = static_cast<TileMapLayer*>( mLayer ); |
nothing calls this directly
no test coverage detected