fix(pets): tamed pandas and crabs leave their spawn groups

The live server scripts (l_fv_panda_server.lua, l_crab_server.lua, in
the client's res/scripts) take a tamed pet out of the groups it was
spawned into: the panda leaves "pandas" and "panda<tamer>", the crab
"crab<tamer>". The panda spawner counts "pandas" (at most five) and
"panda<player>" (one per player), so tamed pandas used to keep counting
against both. Entity gets RemoveFromGroup for it.

The dig and object pet scripts keep their TODO: their live server
scripts are not shipped with the client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 08:41:28 -05:00
parent 6819c67068
commit 63e85d396d
4 changed files with 10 additions and 2 deletions

View File

@@ -37,7 +37,8 @@ void CrabServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTami
auto* petComponent = self->GetComponent<PetComponent>();
if (petComponent == nullptr)
return;
// TODO: Remove custom group?
// The live script takes the tamed crab out of its tamer's group
self->RemoveFromGroup("crab" + std::to_string(tamer->GetObjectID()));
// Command the pet to the player as it may otherwise go to its spawn point which is non existant
// petComponent->Command(NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 6, 202, true);
}