MCPcopy Create free account
hub / github.com/ddnet/ddnet / SetTile

Method SetTile

src/game/editor/mapitems/layer_front.cpp:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8}
9
10void CLayerFront::SetTile(int x, int y, CTile Tile)
11{
12 if(Tile.m_Index == TILE_THROUGH_CUT)
13 {
14 Map()->m_pGameLayer->CLayerTiles::SetTile(x, y, CTile{TILE_NOHOOK}); // NOLINT(bugprone-parent-virtual-call)
15 }
16 else if(Tile.m_Index == TILE_AIR && CLayerTiles::GetTile(x, y).m_Index == TILE_THROUGH_CUT)
17 {
18 Map()->m_pGameLayer->CLayerTiles::SetTile(x, y, CTile{TILE_AIR}); // NOLINT(bugprone-parent-virtual-call)
19 }
20 if(Editor()->IsAllowPlaceUnusedTiles() || IsValidFrontTile(Tile.m_Index))
21 {
22 CLayerTiles::SetTile(x, y, Tile);
23 }
24 else
25 {
26 CLayerTiles::SetTile(x, y, CTile{TILE_AIR});
27 ShowPreventUnusedTilesWarning();
28 }
29}
30
31void CLayerFront::Resize(int NewW, int NewH)
32{

Callers

nothing calls this directly

Calls 3

MapFunction · 0.85
IsValidFrontTileFunction · 0.85

Tested by

no test coverage detected