mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-20 04:09:16 +00:00
Track NPC clones
Manual state management in python was kind of fiddly, so let's track all avatar clones in the NetApp and unload them as needed. This also seems to fix a potential bug in plNPCSpawnMod (is that even used?).
This commit is contained in:
@ -217,11 +217,17 @@ plKey plAvatarMgr::LoadAvatar(const char *name, const char *accountName, bool is
|
||||
return result;
|
||||
}
|
||||
|
||||
void plAvatarMgr::UnLoadAvatar(plKey avatarKey, bool isPlayer)
|
||||
void plAvatarMgr::UnLoadAvatar(const plKey& avatarKey, bool isPlayer, bool netPropagate) const
|
||||
{
|
||||
hsBool isLoading = false;
|
||||
plLoadAvatarMsg *msg = new plLoadAvatarMsg(avatarKey, GetKey(), 0, isPlayer, isLoading);
|
||||
msg->Send();
|
||||
if (avatarKey)
|
||||
{
|
||||
plKey requestor = GetKey();
|
||||
plLoadAvatarMsg* msg = new plLoadAvatarMsg(avatarKey, requestor, 0, isPlayer, false);
|
||||
|
||||
// only netprop if the user has a death wish
|
||||
msg->SetBCastFlag(plMessage::kNetPropagate, netPropagate);
|
||||
msg->Send();
|
||||
}
|
||||
}
|
||||
|
||||
// our player's already loaded locally, but we've just linked into an age and others there need to be
|
||||
@ -271,22 +277,6 @@ bool plAvatarMgr::UnPropagateLocalPlayer()
|
||||
return false;
|
||||
}
|
||||
|
||||
// UNLOADREMOTEPLAYER
|
||||
void plAvatarMgr::UnLoadRemotePlayer(plKey remotePlayer)
|
||||
{
|
||||
if(remotePlayer)
|
||||
{
|
||||
plKey requestor = GetKey();
|
||||
bool isPlayer = true;
|
||||
hsBool isLoading = false;
|
||||
plLoadAvatarMsg * msg = new plLoadAvatarMsg(remotePlayer, requestor, 0, isPlayer, isLoading);
|
||||
|
||||
// don't propagate over the network. this is just for removing our local version
|
||||
msg->SetBCastFlag(plMessage::kNetPropagate, false);
|
||||
msg->Send();
|
||||
}
|
||||
}
|
||||
|
||||
// UNLOADLOCALPLAYER
|
||||
void plAvatarMgr::UnLoadLocalPlayer()
|
||||
{
|
||||
|
Reference in New Issue
Block a user