| 28519 | } |
| 28520 | |
| 28521 | node_t* TileEntityListHandler::updateEntity(Entity& entity) |
| 28522 | { |
| 28523 | if ( !entity.myTileListNode ) |
| 28524 | { |
| 28525 | return nullptr; |
| 28526 | } |
| 28527 | |
| 28528 | int x = (static_cast<int>(entity.x) >> 4); |
| 28529 | int y = (static_cast<int>(entity.y) >> 4); |
| 28530 | if ( x >= 0 && x < kMaxMapDimension && y >= 0 && y < kMaxMapDimension ) |
| 28531 | { |
| 28532 | list_RemoveNode(entity.myTileListNode); |
| 28533 | entity.myTileListNode = list_AddNodeLast(&TileEntityList.gridEntities[x][y]); |
| 28534 | entity.myTileListNode->element = &entity; |
| 28535 | entity.myTileListNode->deconstructor = &emptyDeconstructor; |
| 28536 | entity.myTileListNode->size = sizeof(Entity); |
| 28537 | return entity.myTileListNode; |
| 28538 | } |
| 28539 | |
| 28540 | return nullptr; |
| 28541 | } |
| 28542 | |
| 28543 | void TileEntityListHandler::clearTile(int x, int y) |
| 28544 | { |
no test coverage detected