MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / CorpseFix

Method CorpseFix

zone/entity.cpp:3359–3399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3357}
3358
3359void EntityList::CorpseFix(Client* c)
3360{
3361 uint32 fixed_count = 0;
3362 for (const auto& e : corpse_list) {
3363 auto cur = e.second;
3364 if (cur->IsNPCCorpse()) {
3365 if (DistanceNoZ(c->GetPosition(), cur->GetPosition()) < 100) {
3366 c->Message(
3367 Chat::White,
3368 fmt::format(
3369 "Attempting to fix {}.",
3370 cur->GetCleanName()
3371 ).c_str()
3372 );
3373
3374 cur->GMMove(
3375 cur->GetX(),
3376 cur->GetY(),
3377 cur->GetFixedZ(c->GetPosition()),
3378 c->GetHeading()
3379 );
3380
3381 fixed_count++;
3382 }
3383 }
3384 }
3385
3386 if (!fixed_count) {
3387 c->Message(Chat::White, "There were no nearby NPC corpses to fix.");
3388 return;
3389 }
3390
3391 c->Message(
3392 Chat::White,
3393 fmt::format(
3394 "Fixed {} nearby NPC corpse{}.",
3395 fixed_count,
3396 fixed_count != 1 ? "s" : ""
3397 ).c_str()
3398 );
3399}
3400
3401// returns the number of corpses deleted. A negative number indicates an error code.
3402uint32 EntityList::DeletePlayerCorpses()

Callers 1

command_corpsefixFunction · 0.80

Calls 11

DistanceNoZFunction · 0.85
GetPositionMethod · 0.80
GetFixedZMethod · 0.80
IsNPCCorpseMethod · 0.45
MessageMethod · 0.45
c_strMethod · 0.45
GetCleanNameMethod · 0.45
GMMoveMethod · 0.45
GetXMethod · 0.45
GetYMethod · 0.45
GetHeadingMethod · 0.45

Tested by

no test coverage detected