MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / pickUpEntity

Method pickUpEntity

source/game/Player.cpp:269–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void Player::pickUpEntity(GameEntity *entity)
270{
271 if(!entity->tryPickup(getSeat()))
272 {
273 OD_LOG_ERR("player seatId" + Helper::toString(getSeat()->getId()) + " couldn't pickup entity=" + entity->getName());
274 return;
275 }
276
277 OD_LOG_INF("player seatId=" + Helper::toString(getSeat()->getId()) + " picked up " + entity->getName());
278 entity->pickup();
279
280 // Start tracking this creature as being in this player's hand
281 addEntityToHand(entity);
282
283 if (mGameMap->isServerGameMap())
284 {
285 entity->firePickupEntity(this);
286 return;
287 }
288
289 if (this != mGameMap->getLocalPlayer())
290 {
291 OD_LOG_ERR("cannot pickup entity player seat=" + Helper::toString(getSeat()->getId()) + ", localPlayer seat id=" + Helper::toString(mGameMap->getLocalPlayer()->getSeat()->getId()) + ", entity=" + entity->getName());
292 return;
293 }
294 RenderManager::getSingleton().rrPickUpEntity(entity, this);
295}
296
297
298bool Player::isDropHandPossible(Tile *t, unsigned int index)

Callers 6

processMessageMethod · 0.80
saveWoundedCreaturesMethod · 0.80
handleDefenseMethod · 0.80
handleTiredCreaturesMethod · 0.80
handleHungryCreaturesMethod · 0.80

Calls 9

isServerGameMapMethod · 0.80
firePickupEntityMethod · 0.80
getLocalPlayerMethod · 0.80
rrPickUpEntityMethod · 0.80
toStringFunction · 0.70
tryPickupMethod · 0.45
getIdMethod · 0.45
pickupMethod · 0.45
getSeatMethod · 0.45

Tested by

no test coverage detected