| 3357 | } |
| 3358 | |
| 3359 | void 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. |
| 3402 | uint32 EntityList::DeletePlayerCorpses() |
no test coverage detected