MCPcopy Create free account
hub / github.com/SpartanJ/eepp / autoFixTilePos

Method autoFixTilePos

src/modules/maps/src/eepp/maps/gameobject.cpp:133–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void 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
152void GameObject::assignTilePos() {
153 TileMapLayer* TLayer = static_cast<TileMapLayer*>( mLayer );

Callers

nothing calls this directly

Calls 3

getGameObjectMethod · 0.80
moveTileObjectMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected