MCPcopy Create free account
hub / github.com/TurningWheel/Barony / updateEntity

Method updateEntity

src/entity.cpp:28521–28541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28519}
28520
28521node_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
28543void TileEntityListHandler::clearTile(int x, int y)
28544{

Callers 7

actBoulderFunction · 0.80
gameLogicFunction · 0.80
teleportMethod · 0.80
teleportAroundEntityMethod · 0.80
teleporterMoveMethod · 0.80
spellEffectTeleportPullFunction · 0.80
spellEffectDemonIllusionFunction · 0.80

Calls 2

list_RemoveNodeFunction · 0.85
list_AddNodeLastFunction · 0.85

Tested by

no test coverage detected