MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / clearPlayerBlocks

Function clearPlayerBlocks

src/clientbase/GfxBlock.cpp:257–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255//============================================================================//
256
257static bool clearPlayerBlocks(Player* player, void* data) {
258 EventClient* ec = (EventClient*)data;
259
260 // clear the player block
261 player->getGfxBlock().remove(ec);
262 player->getRadarGfxBlock().remove(ec);
263
264 // clear the player shot blocks
265 const int maxShots = player->getMaxShots();
266 for (int s = 0; s < maxShots; s++) {
267 ShotPath* shot = player->getShot(s);
268 if (shot) {
269 shot->getGfxBlock().remove(ec);
270 shot->getRadarGfxBlock().remove(ec);
271 }
272 }
273
274 return false; // do not break the loop
275}
276
277
278void GfxBlockMgr::removeClient(EventClient* ec) {

Callers

nothing calls this directly

Calls 3

removeMethod · 0.45
getMaxShotsMethod · 0.45
getShotMethod · 0.45

Tested by

no test coverage detected